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.
The name collision was not intentional — I didn't know about the original Portable C Compiler when I named this project. But hey, compiling C portably is exactly what we're doing, just 50 years later and in Python.
2 comments