What is a self-hosting compiler?

A self-hosting compiler is a compiler that is written in the language it compiles. Once self-hosted, the language no longer depends on another language for its compiler. Self-hosting languages include Rust, Go, TypeScript, Haskell, and Kotlin, among others.

Details

Self-hosting is closely related to bootstrapping. A compiler is self-hosting when its source code is written in the language it compiles — meaning it can compile itself.

Self-hosting compilers:

Self-hosting is considered a sign of language maturity. It also provides a kind of correctness check: if the language's own compiler works, many of the language's features have been validated in a real-world use case.

Explore in the Graph

See implementation and influence relationships interactively.

Open Interactive Graph →

Related Pages