From 31ae8b8b07a312df5cc83ff24457b0043c131f51 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 4 Apr 2020 13:17:04 -0500 Subject: [PATCH] write a bit about bootstrapping --- src/overview.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/overview.md b/src/overview.md index d92142e3..7b8cae83 100644 --- a/src/overview.md +++ b/src/overview.md @@ -270,7 +270,23 @@ but there are already some promising performance improvements. ### Bootstrapping -**TODO (or do we want such a section)?** +`rustc` itself is written in Rust. So how do we compile the compiler? We use an +older compiler to compile the newer compiler. This is called _bootstrapping_. + +Bootstrapping has a lot of interesting implications. For example, it means that one +of the major users of Rust is Rust, so we are constantly testing our own +software ("eating our own dogfood"). Also, it means building the compiler can +take a long time because one must first build the compiler and then use that to +build the new compiler (sometimes you can get away without the full 2-stage +build, but for release artifacts you need the 2-stage build). + +Bootstrapping also has implications for when features are usable in the +compiler itself. The build system uses the current beta compiler to build the +stage-1 bootstrapping compiler. This means that the compiler source code can't +use some features until they reach beta (because otherwise the beta compiler +doesn't support them). On the other hand, for compiler intrinsics and internal +features, we may be able to use them immediately because the stage-1 +bootstrapping compiler will support them. # Unresolved Questions