Remix.run Logo
▲ DetroitThrow 2 hours ago

I'm a bit confused why a decision to decrease the maintenance burden of Mold by switching languages makes Rust the wrong tool here? Fearless concurrency sounds like a huge benefit for what they're doing, given the resources they have.

▲compiler-guy 2 hours ago | parent | next [-]

It's simply an ordering problem. When building the entire world from scratch, usually the C and C++ toolchains are built near the very first, and Rust toolchains built somewhat later. Anything written in Rust must come after the Rust toolchain is built. You need a linker as part of your C++ toolchain, so it must be written in a language ready to go at that point. If it is written in C, you are done. If it is written in Rust you have to wait. So a Rust-based linker can no longer be used from that very, very early C bootstrap.

It's not a big deal for normal users, where you have Rust ready to go. Kind of a bummer in this case, but this is a specialized one.

▲someonebaggy 37 minutes ago | parent | next [-]

Maybe that's about to flip. Maybe Rust will be built first, followed by C.

▲ 32 minutes ago | parent | next [-]
[deleted]
▲afdbcreid 30 minutes ago | parent | prev [-]

Rust requires LLVM (or GCC) which requires C++, not just C.

▲someonebaggy 10 minutes ago | parent [-]

Maybe it should be rewritten in Rust then

▲veber-alex an hour ago | parent | prev [-]

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?

▲compiler-guy an hour ago | parent [-]

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.

▲SleepyMyroslav 34 minutes ago | parent [-]

Why do you keep saying C? Mold was C++ with some dependencies like TBB or zstd.

▲compiler-guy 10 minutes ago | parent | next [-]

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.

▲ 13 minutes ago | parent | prev [-]
[deleted]
▲tadfisher 23 minutes ago | parent | prev [-]

One of the explicit goals for Mold 3.0 is to promote its use as the default linker in Linux distributions, and bootstrapping complexity is certainly worthy of consideration in that realm.

> We will then conduct extensive compatibility testing and work closely with Linux distribution developers to make it practical for them to adopt mold as /usr/bin/ld. Making this happen is one of our highest priorities for mold 3.x.