What is a Self-Hosting Compiler?
A self-hosting compiler is a compiler that can compile the source code of its own compiler. This means the language implementation is written in the language itself.
What Self-Hosting Means
If a language is self-hosting, its compiler source code is written in that same language. For example, the Rust compiler (rustc) is written in Rust. The GHC Haskell compiler is written in Haskell.
Benefits of Self-Hosting
- Proves the language is powerful enough for systems programming
- Allows compiler developers to use the language's own features
- Enables compiler-driven language bootstrapping
- Acts as a large, real-world test case for the language
Self-Hosting vs. Bootstrapping
Bootstrapping is the process of achieving self-hosting. A self-hosting language is the result. Not all languages are self-hosting — many interpreters are written in C and never become self-hosting.
Explore in Graph →