About this project

rucc is an early-stage optimizing C compiler written in Rust. According to the README, the project's target ladder is SQLite, then a mid tier of well-known C projects, then PostgreSQL, and eventually the Linux kernel, with no source patches allowed on that ladder. The README states clearly that nothing compiles C yet. M0 and M1 are complete, tagged v0.1.0 and v0.2.0. M0 covered the workspace, the checked layer rule, the driver's argument parsing and phase plan, the job scheduler, and CI on Linux, macOS and Windows. M1 is the preprocessor, described as finished: translation phases, hide set macro expansion, directives including _Pragma and #embed, include resolution with #include_next and #pragma once, the __has_* family, and predefined macros generated from the target description. rucc -E a.c is described as a real preprocessor whose output is diffed against a reference compiler over glibc and musl header sets. rucc a.c currently prints the phase plan and reports that phases after preprocessing are not implemented. The design section describes several planned or in-progress choices. Rewrite rules and instruction selection patterns are written in one DSL; the same rule text is compiled into the matcher and handed to an SMT solver in CI, and rules the solver cannot discharge do not enter the rule set. The IR is intended to have no poison and no undef. Acyclic e-graphs are planned for rewriting, constant folding and global code motion, with both an e-graph rewriter and a conventional pass pipeline built and measured to choose a winner. A layer rule is checked by cargo xtask layers, assigning crates ranks so a crate may depend only on strictly lower ranks. The compile path aims to have no external assembler or linker: instructions are encoded to bytes, ELF, Mach-O and COFF are written in-project, and DWARF is emitted in-project. The README states that linking still shells out to a real linker before 1.0, and that whether this remains true is an open question. The README frames goals as measurable claims on correctness, compile throughput, code quality and portability, with methodology and reporting rules placed in spec/16-performance.md before results exist. Repository layout described in the README includes crates for the compiler, build-tools for the rule DSL compiler and SMT verifier, runtime crates compiled for the target, twenty spec documents plus seventeen cross-compilation documents, generated docs, xtask build automation, and tests. Installation options include prebuilt binaries for Linux, macOS and Windows with SHA-256 files and build provenance attestations, as well as cargo install rucc. Building is documented as git clone, cargo build --release, with no configure, CMake, Python in the build, or code generation outside build.rs and xtask. Tasks include cargo xtask layers, cargo xtask style, and cargo xtask ci. The README lists out-of-scope items as C++, MSVC dialect extensions, a JIT, MSan, and a CompCert-style verified compiler. The license is Apache-2.0.