Skip to content

postc — the POST Compiler

postc is a multi-backend ahead-of-time compiler for POST Python (Performance-Optimized Statically Typed Python). It lowers a typed Python subset through a backend-agnostic typed SSA IR to multiple native backends selectable at runtime.

  • Backends: C, QBE, and LLVM (via llvmlite) are registered and selectable; a WebAssembly MVP (scalars + arrays, run in wasmtime/node) emits WAT.
  • Selectable at runtime: postc build --backend {c,qbe,llvm}, the POSTC_BACKEND environment variable, or the backend= API argument.
  • Correctness by construction: every backend is held to a differential test oracle — its output must match CPython semantically and the C backend byte-for-byte where the arithmetic is exact.

postc builds on postpyc — the POST Python reference implementation created by Travis E. Oliphant and contributors, whose backend-agnostic typed SSA IR is the foundation this project stands on. postpyc lives on as the reference implementation and postc's benchmark baseline; see ADR-0000 for the rationale and credits, and the language specification (a vendored copy of the canonical post-py.org spec).

Where to go next