What is GHC written in?
Glasgow Haskell Compiler.
The GHC compiler is written in Haskell (well-documented). Its runtime is implemented in C (well-documented). GHC uses a bootstrap chain from Lazy ML (well-documented). GHC is self-hosting.
Relationship Graph
All directly connected languages. Click any node to navigate to its page.
Compiler Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| Haskell | 99% | GHC is written in Haskell (self-hosting since 1989 rewrite by Hall, Partain, and Peyton Jones) | Source |
Runtime Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| C | 97% | GHC's runtime system (RTS) is written in C and C-- | Source |
Bootstrap Chain
| Language | Confidence | Notes | Source |
|---|---|---|---|
| Lazy ML | 95% | Original GHC prototype written in Lazy ML by Kevin Hammond in 1989 before the Haskell rewrite | Source |
Frequently Asked Questions
What language is GHC written in?
GHC is primarily implemented in Haskell and C and Lazy ML. See the implementation section above for details and source references.
Is GHC self-hosting?
Yes, GHC is self-hosting — its compiler can compile itself.