Home Explore Blog CI



rustc

src/building/bootstrapping/intro.md
278f48a296d3bba6c5f5ffa0c2c0b1955f105607b9e3dba50000000300000460
# Bootstrapping the compiler

[*Bootstrapping*][boot] is the process of using a compiler to compile itself.
More accurately, it means using an older compiler to compile a newer version
of the same compiler.

This raises a chicken-and-egg paradox: where did the first compiler come from?
It must have been written in a different language. In Rust's case it was
[written in OCaml][ocaml-compiler]. However, it was abandoned long ago, and the
only way to build a modern version of rustc is with a slightly less modern
version.

This is exactly how `x.py` works: it downloads the current beta release of
rustc, then uses it to compile the new compiler.

In this section, we give a high-level overview of
[what Bootstrap does](./what-bootstrapping-does.md), followed by a high-level
introduction to [how Bootstrap does it](./how-bootstrap-does-it.md).

Additionally, see [debugging bootstrap](./debugging-bootstrap.md) to learn
about debugging methods.


Chunks
2060bfe3 (1st chunk of `src/building/bootstrapping/intro.md`)
Title: Bootstrapping the Rust Compiler
Summary
This section explains the concept of bootstrapping, where a compiler compiles itself, and how Rust's `x.py` tool uses a beta release of rustc to compile a newer version. It also mentions the original OCaml compiler and provides an overview of what bootstrapping does and how it works, along with debugging tips.