Guix uses mrustc for bootstrapping Rust, as required for compiler packages; it's a really impressive project and has worked well in that role for some time. This new project is interesting for other reasons though, because mrustc is targeted at the de fact "subset" of Rust in use by rustc at any given time. This looks like it could have broader applications, like compiling Rust programs for platforms not supported by LLVM. If it really targets ANSI C (C89 or so), that's potentially many more platforms than are possible with ordinary rustc
More on the Rust bootstrapping process (2018): https://guix.gnu.org/blog/2018/bootstrapping-rust/
> compiling Rust programs for platforms not supported by LLVM
For this, gcc-rs[1][2] is the most promising candidate.
[1] https://rust-gcc.github.io/
[2] https://github.com/Rust-GCC/gccrs
Gccrs is valuable for various reasons (bootstrapping, refining the spec, etc), but for the main purpose of "compiling to targets supported by gcc but not llvm", it's definitely not as promising as https://github.com/rust-lang/rustc_codegen_gcc. It's a rustc backend, at the same level as llvm or cranelift, it's much further along than gccrs (already available as a rustup component and can compile any rust code) and will not suffer from lagging behind rustc.
But OP has wider ambitions: the real niche targets are supported by neither gcc nor llvm. A rust-to-c transpiler that can adapt to weird C compilers should have a very wide reach.
But what about platforms that even GCC doesn't support well? I'm thinking mostly retro stuff like 16-bit x86.
I might have seen that Bootstrapping Rust article, how interesting. I've been curious about Guix for a while, one of these days I need to dive in and explore deeper. I really enjoyed their article on full-source bootstrap, it's relevant now more than ever.
Building from Source All the Way Down - https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-...