Metadata-Version: 2.4
Name: JustInline
Version: 0.1.0
Summary: Python interface for JIL, the library for fast computations with straight-line programs
Author-Email: Ricardo Buring <buring@lix.polytechnique.fr>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Project-URL: Home, https://src.koda.cnrs.fr/ODELIX/JustInline
Description-Content-Type: text/markdown

# JustInline

[Python](https://www.python.org/) interface for [JIL](https://sourcesup.renater.fr/projects/jil/), the library for fast computations with straight-line programs.

## Installation

JustInline requires Python 3.x. Binaries are provided on PyPI for the following platforms:

- Linux (manylinux: x86-64, aarch64, musllinux: x86-64, aarch64)
- macOS (arm64, x86-64)

For these platforms, JustInline can be installed with the following command:

```
pip install --upgrade JustInline
```

To update JustInline to the latest version, re-run the above command and restart Python if the JustInline package was imported before.

## Example usage

Record the trace of a generic execution of a Python function `f` to an SLP `p`:

```python
def f(x,y):
  return 3*x*y + 8*(x+y)
from JustInline import *
R64 = get_r64_domain()
recorder_start(R64)
in_ = input_variables(2)
out = output_variables(1)
out[0] = f(in_[0], in_[1])
p = recorder_end(out)
```

Next, JIT compile the SLP `p` to a map `f_jit`, and apply it to a vector `v`:

```python
f_jit = as_jit(p)
v = as_object([object(2, R64), object(-2, R64)])
apply(f_jit, v)
```
