About this handbook

An interactive guide to the Glasgow Haskell Compiler, assembled by reading GHC's own source and the reasoning its authors left behind in it.

What it is built from

Everything here is pinned to a single GHC release, ghc-9.14.1-release. The prose is written for this handbook; the quoted comments, code, and cross-references are extracted mechanically from that tree, so every claim can be traced to a line of source.

GHC version9.14.1
Source tagghc-9.14.1-release
Notes extracted3,270
Cross-references8,938
Resolved 8,576 (96%)
Files scanned1,977

On the unresolved references

Roughly 4% of Note [...] mentions do not resolve to a Note that still exists. That is not a defect in the extraction. It is GHC's own drift: Notes get renamed, merged, or deleted while the comments pointing at them stay behind. Rather than guess, the extractor records them, and ambiguous titles are left unlinked instead of being resolved to the wrong Note.

Reading levels

Chapters are written in two layers. The prose explains what a phase does and why it is shaped the way it is, useful if you write Haskell and want to know what happens to it. Interleaved with it are the primary sources: the actual Notes, the actual data types, and links into the actual source. Follow those if you intend to work on the compiler.

Licensing

GHC is licensed under a BSD-3-Clause licence. Quoted comments and code excerpts remain under that licence and belong to their authors. The original prose of this handbook is separate from the GHC project and is not endorsed by it.