Post

HN
Hacker News

crustc: entirety of `rustc`, translated to C

This is a functional Rust compiler you can build with GCC & make .

It is just C code [1], which, when compiled, gives you a functional Rust compiler.

That Rust compiler can compile code - build core , alloc , std - you name it!

This is a demo/teaser for my new Rust to C compiler toolchain. The full cilly toolchain compiles your own Rust to C for arbitrary targets . This repo just shows the compiler compiling itself, as I believe this is the flashiest showcase I could do.

For the past 3 years, I have been working on compiling Rust to C. I made a few public attempts, like rustc_codegen_clr , and a lot of private ones.

This is, by my count, the 14th attempt: cilly . It is a Rust library for generating C code and a Rust compiler backend (read: plugin) that allows you to compile Rust to C.