Installation¶
postpile is developed with uv. A checkout is self-contained. This page covers the recommended uv setup, a plain pip alternative, and the system prerequisites no Python package manager installs for you: a C compiler, and, per backend, the qbe binary or the WASM toolchain (llvmlite, for the LLVM backend, is pip-installable via the llvm extra).
Requirements¶
| Requirement | Notes |
|---|---|
| Python >= 3.12 | The test suite runs on 3.14 and 3.15, whose behaviour compiled programs follow. |
| A C compiler | cc / clang / gcc; every backend ends by compiling/linking a native object with it. |
qbe |
Only for the QBE backend, and optional even then: with no system qbe, the backend builds its bundled MIT-licensed qbe 1.3 source once on first use. See the QBE backend. |
llvmlite |
Only for the LLVM backend, pip-installable via the llvm extra. See the LLVM backend. |
zig, and wasmtime or node |
Only for --target wasm32-wasip1. zig comes from PATH or the bundled extra. See the WebAssembly target. |
The sibling ../postpython checkout |
Optional, only for the postpyc benchmark baseline (uv pip install -e ../postpython). |
Repository layout¶
A postpile checkout stands alone. The postyp type vocabulary is temporarily vendored at vendor/postyp (its README states why and the retirement condition: a PyPI postyp release with what the suite needs). One thing remains optional and sibling-shaped: the postpyc benchmark baseline, the reference implementation postpile is measured against over time (see Benchmarking).
git clone https://git.sr.ht/~sfermigier/postpile
cd postpile
# optional, benchmarks-baseline only:
git clone https://github.com/openteams-ai/postpython ../postpython
Without the sibling, everything works except the postpyc rows of the benchmark harness, which skip with a note.
Install with uv (recommended)¶
From the postpile/ checkout:
That installs the runtime dep (postyp, vendored), the default groups, dev (pytest, ruff, the type checkers, nox, hypothesis, numpy, narwhals) and docs (zensical), and every optional-dependency extra. The postpyc baseline (needs the sibling) is opt-in: uv pip install -e ../postpython.
For a leaner environment, sync selectively:
uv sync # runtime deps only (postyp)
uv sync --group dev # + the test/lint toolchain
uv sync --extra numpy # + a single extra
Install with pip¶
pip works too. Because the type vocabulary is a vendored path dep during development, install it editable first:
Add extras in the usual way: pip install -e '.[numpy,narwhals]'.
Extras¶
Backend toolchains and their optional integrations opt in via extras, keeping the core dependency-light. The C and QBE backends need only a system C compiler (and the qbe tool); the LLVM backend needs the llvm extra:
| Extra | Pulls in | For |
|---|---|---|
llvm |
llvmlite |
The LLVM backend. |
wasm |
wasmtime |
Runs WebAssembly target modules in process, in the tests and the benchmarks. |
numpy |
numpy |
NumPy-facing code paths. |
narwhals |
narwhals |
Dataframe-facing code paths. |
bundled |
ziglang |
A machine with no system C compiler: zig cc stands in whenever cc is not on PATH. |
System prerequisites¶
These are not pip-installable and must be present on your PATH.
C compiler¶
Both backends produce native code by compiling emitted source with a C compiler. Any of cc, clang, or gcc works.
cc --version # macOS: ships with the Xcode command-line tools
# Debian/Ubuntu: sudo apt install build-essential
# Fedora: sudo dnf install gcc
qbe¶
The QBE backend lowers the IR to QBE IL, which the qbe tool assembles. A system install is preferred and always wins:
With no qbe on PATH, the backend builds its bundled source (the pinned upstream 1.3 release, MIT; provenance in src/postpile/_qbe/) once on first use, into ~/.cache/postpile/, using the same C compiler everything else needs. POSTPILE_QBE_CACHE overrides the cache location; POSTPILE_QBE_CACHE=0 disables the bundled build entirely.
Toolchain details what each backend shells out to.
Verify¶
Then work through Getting started, or see the full CLI reference. To run the test suite and doc build, see Testing: