// the find
rui314/chibicc
A small C compiler
chibicc is a small, from-scratch C11 compiler written as the reference implementation for a book on compiler construction. It's for people who want to actually read working compiler source and understand how C gets lowered to x86-64 assembly, not for anyone who needs a production toolchain.
Each commit corresponds to a book section and stays bug-free by design (bugs get fixed by rewriting history at the source commit, not patched forward), so you can read the git log like a tutorial and see exactly how a feature like VLAs or thread-locals gets added one step at a time. It's not a toy in the usual sense: it handles bitfields, variable-length arrays, compound literals, atomics, and the SysV struct-passing ABI well enough to compile Git, SQLite, and libpng and pass their test suites. The code deliberately avoids clever abstractions (duplicated parser functions instead of higher-order tricks, calloc-and-never-free memory management) which is exactly right for a teaching codebase.
No optimization pass — generated code is roughly 2x+ slower than gcc output, so it's not something you'd target for real builds. Last push was October 2023 and the author explicitly doesn't take PRs (patches get rewritten into prior commits or ignored), so don't expect this to track new C standards or get external bug fixes merged normally. It's x86-64/Linux only with no stated portability goal, and it skips K&R prototypes, complex numbers, and GCC inline asm, which will bite you if you're compiling anything older or more exotic than the test corpus covers.