Mold Linker Version 3.0.0 Release – Rewritten in Rust
A high‑performance ELF linker, mold, has released version 3.0 after migrating its codebase from C/C++ to Rust, reportedly with substantial help from large language models. Commenters weigh the benefits of Rust—memory safety, safer concurrency, and growing ecosystem support—against drawbacks such as weaker support for obscure architectures and significantly more complex bootstrapping, which is a major concern for security‑focused Linux distributions that rebuild everything from minimal trusted code. The change also prompts comparisons with other fast linkers and systems languages like Zig, as well as broader worries about Rust’s dependency footprint and its implications for reproducible, supply‑chain‑secure builds.
Motivation for Rust Rewrite
- Some speculate main drivers are memory safety, robust handling of corrupted inputs, and especially safer/finer-grained concurrency.
- Others argue hardening C/C++ against malformed input is possible, but several posters counter that proving large C/C++ codebases safe over time is extremely costly and error‑prone.
Use of AI/LLM in the Rewrite
- Multiple commenters note commits crediting an LLM and links to comments where the author reportedly confirms using LLM assistance.
- Debate over whether this is “rewrite” vs “transpile”; consensus leans that Rust is now the primary, human-edited source.
Rust vs C/C++/Zig and Safety/Performance
- Many see Rust as enabling “fearless concurrency” and eliminating whole classes of bugs (use-after-free, data races, double free).
- Some emphasize that bounds checks are only a small part of Rust’s safety guarantees.
- Zig is discussed as “better C” but lacking Rust’s compile-time memory guarantees; safe vs fast build modes and UB from disabled checks are concerns.
- Others note non-technical factors: Rust’s ecosystem maturity, industry backing, and adoption vs Zig’s relative youth.
Platform and Backend Support
- Discussion on Rust’s platform coverage: LLVM vs GCC backends.
- LLVM lacks several legacy/obscure architectures that GCC supports (e.g., Alpha, Itanium, PA‑RISC, SuperH); Rust’s GCC backend is mentioned as partially addressing this.
Comparison with Wild Linker
- Wild is described as another very fast ELF linker, primarily focused on incremental linking (though it reportedly doesn’t yet support true incremental linking).
- Benchmarks are said to be close; Wild often faster, but they “trade blows,” both far ahead of traditional linkers.
Linux Distro Bootstrapping & Supply-Chain Security
- A co-maintainer of a highly reproducible, from-scratch-bootstrapped distro used mold2 (C/C++) as the early bootstrap linker and is unhappy about the Rust rewrite.
- Their model: bootstrap everything from minimal machine code through tiny C compilers → GCC/LLVM → Rust, with strict no-binary, deterministic, hermetic builds.
- Rust is described as extremely expensive to bootstrap (large dependency graph: Python, Perl, OpenSSL, LLVM, etc.), so having mold in Rust moves it too late in the chain to speed up Rust itself.
- Others propose solutions: using prebuilt binaries, caching, stage0/stage2 Rust compilers, or continuing to use mold2; the distro maintainer rejects these as weakening their threat model (no trusting any prior binaries).
Open-Source Maintenance & Backward Compatibility
- Tension between downstream expectations and upstream freedom:
- Some argue mold “unsolved” a real user need; they wanted more consultation and slower change.
- Others stress maintainers owe no guarantees beyond the license, and users can fork if they rely on niche behaviors.
- Debate over whether large rewrites should instead be new projects vs major-version bumps.
Rust Bootstrapping Tools
- mrustc (Rust-to-C bootstrap compiler) is cited as a way to reach a modern-enough Rust to then self-host.
- Some are puzzled by “obsession” with full bootstrap; others point to rapidly increasing supply-chain attacks as justification.
Other Observations
- Positive reactions to the speed of the rewrite and to Rust’s established status as a systems language.
- Note that mold3’s Cargo.lock is relatively small compared to some Rust projects, with concern that heavy crate usage can undercut security claims.