Someone translated the entire Rust compiler into 46 million lines of C

crustc is rustc — the whole thing — rendered as roughly 46 million lines of C that build with GCC and make. It's a demo of a three-year Rust-to-C project whose real payoff is putting Rust on hardware that has no modern compiler backend.

In brief

The goal isn't the 46M-line artifact; it's the tool that produced it. The author's 'cilly' compiler probes the target C compiler with tiny witness programs instead of assuming anything beyond ANSI C, and can even compile over the network — so 'unsupported target' stops being a knock against Rust.

The thread found the genuinely useful uses. An ex-compiler developer gave a flat endorsement. Others pointed to easier Rust bootstrapping and a security trick: use crustc for Diverse Double-Compiling to check whether the official rustc has a backdoor. The skeptic's fair point: who trusts a beta transpiler on an exotic target?

What crustc is, and why it exists

crustc is the entirety of the Rust compiler (rustc 1.98.0-nightly) translated into roughly 46 million lines of C that compile with GCC and make. It's a demonstration output of "cilly," the author's Rust-to-C compiler — about three years of work and, by their count, their 14th attempt. The point isn't the giant C blob; it's the capability: enabling Rust on old or obscure hardware that lacks an LLVM or GCC backend (Plan 9 is the cited example), so "unsupported targets" stops being a valid strike against the language. Cilly adapts by generating small witness programs that probe the target C compiler's actual behavior — type layouts, alignments — rather than assuming anything beyond ANSI C, and it supports network-transparent compilation over TCP. The full toolchain isn't released yet; the author cites a new job, university, and, memorably, a blender injury ("The blender won. Still have all my fingers, just some stitches").

The thread found the real uses — and the real doubt

The endorsement carried weight because of who gave it:

"As an ex C++ compiler developer, I heartily approve of this project. Kudos." — a former C++ compiler developer

Two use cases stood out. Bootstrapping:

"This could be used within bootstrappable.org… to make bootstrappability of rust incredibly much easier other than the previous route of OCaml and other things." — a commenter familiar with the bootstrappable-OS community

And a security check that turns the transpiler into a trust tool:

"Have you tried Diverse Double-Compiling (DDC) to test if the official rust compiler has a backdoor? Use crustc to compile the rust source code, producing a new compiler. Then use this new compiler and the official rustc binary… to compile the rust source code again. The two outputs should match bit for bit." — a commenter proposing a concrete trust-verification procedure

The fair skepticism is about who this is really for:

"it seems very unlikely that someone targeting an exotic system not supported by rust… would be willing to trust a beta transpiler to not inject any bugs or leaks in the process." — a reader reasoning about the embedded/mainframe audience

That tension is the whole story. As a practical porting tool it has to earn trust it hasn't yet; as a piece of work it's the rare thing in 2026 that impressed HN precisely because it obviously isn't an LLM demo — three years of one person's stubbornness, aimed at making a language run where nobody bothered to make it run.

Get breakdowns like this every day

The top Hacker News stories, unpacked — by email, Telegram, or RSS.

Next story · 23 of 26 Read more
🌍Other

An AI-generated news site invented a reporter to mourn the death of real news

'Michelle Quaid,' 52, wore a polo shirt with her paper's logo over her heart. She never existed. She was a fabricated character in an AI-generated outlet publishing fake stories about how AI is killing local journalism.

★ 154 · 💬 53 · niemanlab.org · 2 min