The GHC Commentary

This tree of wiki pages is a "commentary" on the GHC source code. It contains all the explanatory material that doesn't belong in comments in the source code itself, because the material is wide-ranging, usually covers multiple source files, and is more architectural in nature. The commentary can also be considered a design document for GHC.

For the beginners there is a short getting started guide.

For the dedicated, there are videos of Simon and Simon giving an overview of GHC, at the 2006 GHC Hackathon.

Also check out the GHC Reading List, which gives lots of background reading that will help you understand the actual implementation. Here's another reading list from Stephen Diehl.

Editing the Commentary

Please feel free to add material to the rest of the wiki: don't worry too much about accuracy (in due course someone will edit your contribution). When unsure though please indicate this and its best to ask on the GHC mailing list so you can correct the commentary. Please give some thought to where in the commentary your contribution belongs. GHC has an older commentary (non wiki based) that read like a single coherent narrative, made sure to define terms before using them, and introduced concepts in the order which made them easiest to understand. Please do try to preserve those properties in this wiki commentary. If you're unsure or in a hurry, consider creating a wiki page outside the commentary and linking to it from the commentary (or the "contributed documentation" section below).

Try to link to source files as much as possible by using this macro: [[GhcFile(compiler/Makefile)]]. Also try to add appropriate links to other parts of the commentary.


Contributed Documentation

The above commentary covers the source code of GHC. For material that doesn't concern this topic (such as proposals, work-in-progress and status reports) or that don't fit into the existing structure, you will find them below. Feel free to add new material here but please categorise it correctly.

  • GHCi Debugger
    • Commentary/GHCi: Notes on the implementation details for the support of breakpoints in GHCi.
    • GHCi Debugger: Notes on the implementation details of the GHCi debugger's feature for inspecting values.
  • Cross-cutting concerns: topics which span both the compiler and the runtime system

Old Documentation

Here are some useful, but somewhat-out-of-date resources:

  • The old GHC Commentary: Information on the internals of GHC, in various states of up-to-dateness. We are keen to move this stuff out of its current location and onto this Wiki. If anyone is willing to help do that, even for just a part in which you are interested, we would be delighted. There is a page which tracks the progress of migrating information from the old commentary to this wiki.
  • GHC Papers: Papers and pointers to other documents that relate to the inner workings of GHC.
Last modified 7 days ago Last modified on Oct 19, 2016 12:43:20 PM