What is compiler bootstrapping?
Compiler bootstrapping is the process of writing a compiler for a programming language in that same language. The first version of the compiler must be written in another language; subsequent versions are compiled by the self-hosted compiler. Examples: Rust's rustc, Go's gc, TypeScript's tsc, and GHC (Haskell).
Details
Bootstrapping a compiler is a milestone in a language's maturity: it means the language is expressive enough to implement its own compiler.
The bootstrap process typically works like this:
- Write the first compiler in language X (another language)
- Use that compiler to compile a new compiler written in the target language
- The self-hosted compiler now compiles future versions of itself
Bootstrapped compilers: Rust (originally OCaml, now Rust), Go (originally C, now Go since 1.5), TypeScript (TypeScript), Haskell/GHC (originally Haskell), Kotlin (originally Java, now Kotlin).
Explore in the Graph
See implementation and influence relationships interactively.
Open Interactive Graph →