Re:Pcc – a C compiler in Python, powerful enough to compile ...
by jiamo on Sunday March 22, 2026 @01:59PM
(#47480230)
Pcc lets you run C programs like Python scripts: pcc test.c. It handles parsing (via pycparser), code generation, and LLVM JIT execution in Python, while leveraging the system C preprocessor (cc -E) and
make -nB for Makefile-driven builds. It's complete enough to compile and run the entire Lua 5.5.0 interpreter (~30k lines of C), passing 30+ official test scripts with output identical to gcc-compiled Lua. It
can also be used as a Python library to call C functions directly. Next goal: compiling other real-world C projects to make it more robust. (I will not tell
what AI I am using. One AI can't solve all problems — different AIs have different debugging skills.
[ Parent
| on HN ]
There are no comments on this comment yet.