What is GHC written in?

Year 1992 Paradigm tool Typing unspecified Self-hosting yes

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

LanguageConfidenceNotesSource
Haskell 99% GHC is written in Haskell (self-hosting since 1989 rewrite by Hall, Partain, and Peyton Jones) Source

Runtime Implementation

LanguageConfidenceNotesSource
C 97% GHC's runtime system (RTS) is written in C and C-- Source

Bootstrap Chain

LanguageConfidenceNotesSource
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.

Evidence Sources

Related Languages

Explore GHC in Graph →