Scoopfeeds — Intelligent news, curated.
computer-science

crustc: entirety of `rustc`, translated to C

Hacker News · Jul 2, 2026, 10:57 PM

Key takeaways

  • This is a functional Rust compiler you can build with GCC & make.
  • # We need to provide a path to LLVM(`lib LLVM.so.22.1-rust-1.98.0-nightly`) # I *could* include pre-built LLVM in the project, but I'd rather not embed random binaries in the project.
  • This is a demo/teaser for my new Rust to C compiler toolchain.

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

# We need to provide a path to LLVM(`lib LLVM.so.22.1-rust-1.98.0-nightly`) # I *could* include pre-built LLVM in the project, but I'd rather not embed random binaries in the project. make -j20 LLVM_LIB_DIR=~/.rustup/toolchains/nightly-2026-06-16-aarch64-unknown-linux-gnu/lib It is just C code [1], which, when compiled, gives you a functional Rust compiler.

# It works - (library path to point to lib LLVM.so.22.1-rust-1.98.0-nightly - rustc uses llvm) LD_LIBRARY_PATH=~/.rustup/toolchains/nightly-2026-06-16-aarch64-unknown-linux-gnu/lib:./rustc_driver ./rustc/rustc --version rustc 1.98.0-nightly (c712ea946 2026-06-16) That Rust compiler can compile code - build core, alloc, std - you name it!

Article preview — originally published by Hacker News. Full story at the source.
Read full story on Hacker News → More top stories
Aggregated and edited by the Scoop newsroom. We surface news from Hacker News alongside other reporting so you can compare coverage in one place. Editorial policy · Corrections · About Scoop