// the find
rui314/8cc
A Small C Compiler
8cc is Rui Ueyama's self-hosting C11 compiler for x86-64 Linux, written to be readable rather than fast or complete. It's archived in favor of the author's successor project chibicc, so this is for people who want to read through a working lexer/preprocessor/parser/codegen, not for anyone who needs a C compiler in production.
The code is genuinely written for readability — short files split cleanly by stage (lex.c, cpp.c, parse.c, gen.c) make it easy to trace how a token becomes an AST node becomes x86-64 asm. It's self-hosting with a three-stage bootstrap test (make fulltest) that byte-compares stage2/stage3 output, a solid sanity check that the compiler is deterministic and correct enough to compile itself. The preprocessor implementation follows Dave Prosser's documented algorithm rather than ad-hoc hacks, which is unusually rigorous for a project this size. Decent unit test coverage per language feature (arrays, bitops, varargs, generics, etc.) in test/.
Explicitly unmaintained — last push 2024 but the actual development stopped years earlier, and the README tells you upfront to expect miscompilations on anything beyond its own source. No optimization pass at all, generated code is 2x+ slower than GCC by the author's own admission. Hard-locked to x86-64 Linux with no portability work and no stated intent to add any. If you want the same educational value but actively maintained and more complete, the README itself points you to chibicc instead — there's little reason to start here over there.