A small, self-hosting C compiler supporting C11 features with intentionally simple and readable code for educational purposes.
8cc is a small C compiler that implements the C11 language specification while keeping its codebase minimal and readable. It's designed to compile C programs and serve as educational material for understanding compiler implementation techniques, though it's not optimized for performance.
Compiler enthusiasts, computer science students, and developers interested in learning how C compilers work internally through studying clean, minimal implementation code.
Developers choose 8cc for its educational value—it provides a complete, working C compiler with intentionally simple and readable source code that demonstrates real-world compiler techniques without the complexity of production compilers.
A Small C Compiler
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the full C11 language specification, serving as a thorough reference for modern C features as stated in the README.
Can compile its own source code, providing a practical example of bootstrapping and compiler correctness verification through multi-stage builds.
Source code is intentionally concise and readable, specifically crafted to teach compiler internals like lexer and parser stages.
Components such as the preprocessor and parser are separable, allowing focused learning on individual compilation phases.
Includes unit tests and a 'fulltest' target that verifies compiler stability by comparing stage2 and stage3 binaries.
Generates unoptimized code that is 2x or more slower than GCC, as admitted in the README, making it unsuitable for speed-critical applications.
Only works on x86-64 Linux with no plans for portability, restricting its use to specific environments.
The author warns of compile errors and miscompilations when compiling programs other than itself, indicating low reliability for practical projects.
Project is no longer maintained in favor of chibicc, meaning no updates or bug fixes, which could lead to compatibility issues.