Metadata-Version: 2.4
Name: alphalang
Version: 0.2.2
Requires-Dist: ipython ; extra == 'notebook'
Provides-Extra: notebook
License-File: LICENSE
Summary: Interactive Python bindings for the Alpha language polyhedral compilation toolchain.
Author-email: Louis Narmour <lrnarmour@gmail.com>
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/lnarmour/alpha
Project-URL: Issues, https://github.com/lnarmour/alpha/issues

# alphalang

Python bindings for [Alpha](https://github.com/lnarmour/alpha), a polyhedral compilation language
for expressing and transforming affine programs. `alphalang` exposes the Rust
parse → normalize → schedule → generate pipeline as a small, typed Python API, plus IPython cell
magics (`%%alphalang`, `%%schedule`) for driving it interactively from a Jupyter notebook.

## Quick start

```python
import alphalang

sys = alphalang.parse("""
affine PrefixSum [N]->{:N>0}
    inputs  X: [N]
    outputs Y: [N]
    let Y[i] = reduce(+, [j], {:j<=i}: X[j]);
.
""")
norm = alphalang.normalize(sys)
sched = norm.schedule(
    "{ Y__init[i] -> [i, 0, 0]; Y__reduce[i,j] -> [i, 1, j]; }"
)
print(alphalang.generate(sched))
```

See the [project README](https://github.com/lnarmour/alpha/blob/main/alphalang/README.md) for the
full API, a worked Jupyter notebook example, and source.

