upvote
Can't you just use a statically linked mold binary for the initial bootstrap, just like you use some kind of pre-existing, basic C compiler?
reply
You could. But now you are trusting an entirely new toolchain that can build the Rust-based linker, even if it is statically linked. This toolchain is much larger than a comparatively small and much more easily understood C bootstrap toolchain.

This effectively triples or quadruples (maybe even more) the amount of code you need to trust for the cold bootstrap.

reply
Why do you keep saying C? Mold was C++ with some dependencies like TBB or zstd.
reply
Too many years at Google where the two terms are most often used interchangeably; which is imprecise, but most of the time it doesn't matter. Forgive me for being imprecise here.

The fact remains that rust adds yet another toolchain to the boot process that needs trust and verification.

reply
deleted
reply
Maybe that's about to flip. Maybe Rust will be built first, followed by C.
reply
Sorry to break it to everyone but Rust depends on python which depends on perl and openssl and the majority of any lean full source bootstrapped toolchain tree.

Unless the gcc rust engine is mature any time soon (lol), we have no path to use rust until very late game in a distro build.

The earliest we can bootstrap a go compiler is about 10 minutes. It builds directly from tinycc. Add 6 hours for our fastest compile of the shortest path to rust, with 192 cores.

I am a rust fan too, but it is the worst language to bootstrap, which is why for systems programming I still must often revert to C to have a small and reviewable and fast to build dependency surface.

reply
deleted
reply
Rust requires LLVM (or GCC) which requires C++, not just C.
reply
LLVM is the default yes, there is also an experimental cranelift backend, which is all Rust. Not sure if it is good enough to build the compiler itself using it.

(There is also a GCC backend called codegen_gcc that is pretty far along. And a separate reimplementation of both the frontend and backend using gcc and C++, called gccrs, which is not nearly as far along.)

reply
I'm pretty sure it does not support enough features to build the compiler (e.g. inline asm is not supported at all), and it will also be very, very slow to unusable.
reply
Maybe it should be rewritten in Rust then
reply