Bootstrapping Rust

Slowly, systems programming languages are getting better in the sense of giving more guarantees and automating what can be automated without downsides.

Rust is one of the more promising system programming languages. Its central advantage is that it enforces memory safety and thread safety at compile time, without incurring any runtime overhead.

The part that enforces memory safety is called "the borrow checker".

It has been a long-standing tradition to develop a language far enough to be able to write the language's compiler in the same language, and Rust does the same. Rust is nowadays written in Rust.

We've tracked down the earlier Rust versions, which were written in OCaml, and were planning to use these to bootstrap Rust. But in parallel, John Hodge (Mutabah) developed a Rust compiler, called "mrustc", written in C++.

mrustc is now good enough to compile Rust 1.19.0.

Using mrustc, we were able to build Rust entirely from source with a bootstrap chain like this:

rust@1.28.0
    ^
    |
rust@1.27.2
    ^
    |
rust@1.26.2
    ^
    |
rust@1.25.0
    ^
    |
rust@1.24.1
    ^
    |
rust@1.23.0
    ^
    |
rust@1.22.1
    ^
    |
rust@1.21.0
    ^
    |
rust@1.20.0
    ^
    |
rust@1.19.0
    ^
    |
mrustc@0.8.0
    ^
    |
   g++

Limitations

About GNU Guix

GNU Guix is a transactional package manager for the GNU system. The Guix System Distribution or GuixSD is an advanced distribution of the GNU system that relies on GNU Guix and respects the user's freedom.

In addition to standard package management features, Guix supports transactional upgrades and roll-backs, unprivileged package management, per-user profiles, and garbage collection. Guix uses low-level mechanisms from the Nix package manager, except that packages are defined as native Guile modules, using extensions to the Scheme language. GuixSD offers a declarative approach to operating system configuration management, and is highly customizable and hackable.

GuixSD can be used on an i686, x86_64, ARMv7, and AArch64 machines. It is also possible to use Guix on top of an already installed GNU/Linux system, including on mips64el and aarch64.

This post does not yet carry an agreed-upon license.

موضوع‌های مرتبط:

Bootstrapping Reproducible builds Security

Unless otherwise stated, blog posts on this site are copyrighted by their respective authors and published under the terms of the CC-BY-SA 4.0 license and those of the GNU Free Documentation License (version 1.3 or later, with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts).