mrustc
Alternative rust compiler (re-implementation)
What This Project Does
Mutabah's Rust Compiler (mrustc) is an independent rewrite of the Rust compiler, built from scratch in C++ instead of Rust itself. It can compile Rust programs and has already proven it can build a fully functional copy of the official Rust compiler—a major milestone. However, it's still experimental and not ready for everyday development work yet.
How It Works
The compiler takes an interesting shortcut: it skips one of Rust's most famous features—the borrow checker—during initial compilation, since that step doesn't actually affect the final machine code. Instead, it compiles your Rust code into C code (an intermediate format), then hands off that C code to an existing C compiler to create the final executable. This approach lets the project focus on getting the core compilation right without reimplementing Rust's complex ownership-checking system from scratch. Think of it like translating Rust to C and then compiling the C—the borrow checker still matters for catching bugs, but it doesn't change what the code does.
Who Would Use This and Why
Right now, this is mainly a proof-of-concept and research project. Compiler enthusiasts and people curious about how Rust works might study it. The fact that it can compile rustc itself demonstrates that an alternative Rust compiler is genuinely possible, which validates the language's design. In the future, if completed, it could provide options for platforms or scenarios where the official compiler doesn't work well—though that's not the immediate goal. It also serves as documentation: reading the source code shows how a Rust compiler can be built without needing to know Rust or LLVM deeply.
Current State
The project works on Linux (and partially on Windows and BSD) and can successfully compile Rust's standard library and real programs. You can even use it to build your own projects if you're willing to work around its limitations. The README shows this is an active work-in-progress with a clear roadmap, including plans to add a proper borrow checker, make the output more readable, and potentially support other code generation backends beyond C.