pxx
Pxx is a Pascal and C compiler. Written in pascal, it self-hosts and cross-compiles — x86-64, i386, ARM (32 and 64), riscv, xtensa, and the ESP32.
Flagship: the ESP32, in Pascal and in Python. Pascal and nilpy compile to native code for the ESP32-S3, ESP32-C3 and classic ESP32 as an ESP-IDF component, with no interpreter on the chip; the examples have run on physical boards of all three. See ESP32 and getting started on the ESP32.
Beta 0.1 "Blaise" is out. Download it from
GitHub
(x86-64 Linux; source and prebuilt binaries in one tarball): ./install.sh --yes, then ./pxx hello.py hello. Plain Python in, a static native binary
out. Release notes.
Beta 0.1 "Blaise" at a glance
- On the chip, not just the emulator. On a physical ESP32-C3 and ESP32-S3
(2026-09-28, compiler built from tree
cdd6fd3c1f), every example passed: 12 plus a Wi-Fi access point on the C3, 16 on the S3. A Python program importing a Pascal unit, and a Pascal program calling C, both ran on a real C3. Over real Wi-Fi, 300 HTTP fetches on the S3 and 300 MQTT sessions on each chip ran with 0 errors and no heap growth, beside deliberate-leak controls that would have shown one. - Memory leaks were release blockers. Before pin v441, 164 automated leak
checks, 49 Pascal shapes on seven targets and real programs were re-run;
five compiler leaks were found and fixed. More found since are fixed in
v442, v446 and v447. Still open in v447:
del namein Nil Python frees nothing until the function returns, and reference cycles are never freed. - Cross-platform. Linux on x86-64, i386, aarch64, arm32 and riscv32, plus
wasm32. Threads give each thread its own
threadvarand C__threadon x86-64, i386, aarch64 and arm32 (pin v446). - C. c-testsuite 220 of 220 on x86-64 (pins v441 and v445). SQLite, Lua, zlib, QuickJS and BusyBox build unmodified; BusyBox links with no libc.
- Known issues: Nil Python is best effort, not CPython; C
long doubleis 8 bytes; bare-metal ESP images run under QEMU only;https://through OpenSSL is x86-64 only in v447. The full list is Known issues.
Beta 0.1 "Blaise" (pin v452, September 2026). Development is ongoing: work continues on master, and fixes made since reach the next release. Sponsors are welcome: open an issue titled "Sponsorship" at https://github.com/yoctobyte/pxx/issues.
Features
- Pascal, C and Python frontends — nilpy is mainline, a peer of the other two.
- Self-hosting; highly FPC- and C99-compatible.
- Wrapper-free C import —
uses/importa C header directly, no bindings. - Auto-typing — declare a variable
auto, the compiler infers the type. - libc-free, syscall-only static binaries.
- Cross-compiles to six CPU targets, including the ESP32 through ESP-IDF.
- Managed memory (ansistring, dynamic arrays), OOP, coroutines / async.
Design
- From scratch — not a fork. Targets compatibility, verified against gcc / fpc / cpython as oracles.
- No GNU userland, no libc. Both the compiler and the binaries it emits talk
straight to the Linux kernel through syscalls. Building pxx needs only
make, and only for the tests. - One shared IR under every frontend and target.
- Compiles itself in plain linear pascal — no OOP — so fewer features can miscompile the compiler.
Limitations
- Not fully optimized, and
-O3is experimental. How much slower depends on the program: a sudoku solver takes 2.2x as long as FPC's-O2build (pin v447), and the one Python program measured against CPython, a 3D simulator, ran at 1.89 frames per second against CPython's 37.1 (pin v416). - A beta with a large backlog; expect rough edges. Development is ongoing.