crustc: entirety of `rustc`, translated to C(github.com)
310 points by Philpax 13 hours ago | 61 comments
tl;dr: A developer translated rustc (Rust nightly) into 46 million lines of C that compile with GCC into a functional Rust compiler, as a demo for their unreleased "cilly" Rust-to-C toolchain. Cilly aims to bring Rust to obscure/legacy platforms that have C compilers but no LLVM/GCC support, using "witness programs" to probe compiler features and even supporting network-transparent compilation over TCP to remote C compilers. The full toolchain isn't publicly available yet due to the author's job, thesis, and a blender incident.
HN Discussion:
  • Admiration for the dedication and originality of the niche transpilation project
  • Suggests practical applications like Diverse Double-Compiling to verify compiler trustworthiness
  • Questions whether extending LLVM/GCC would be more practical than building a transpiler
  • ~Notes existing alternatives like LLVM's C backend that could serve the same purpose
  • Humorous quips about Rust-to-C being ironic given the 'rewrite in Rust' trend