# The Glasgow Haskell Compiler (GHC) Commentary [v0.17]

Manuel M. T. Chakravarty
Sigbjorn Finne
Simon Marlow
Simon Peyton Jones
Julian Seward
Reuben Thomas

This document started as a collection of notes describing what I learnt when poking around in the GHC sources. During the Haskell Implementers Workshop in January 2001, it was decided to put the commentary into GHC's CVS repository to allow the whole developer community to add their wizardly insight to the document.

The document is still far from being complete - help it grow!

## Before the Show Begins

- Feedback
- Other Sources of Wisdom

## Genesis

- Outline of the Genesis
- Mindboggling Makefiles
- GHC's Marvellous Module Structure

## The Beast Dissected

- Coding style used in the compiler
- The Glorious Driver
- Primitives and the Prelude
- Just Syntax
- The Basics
- Modules, ModuleNames and Packages
- The truth about names: Names and OccNames
- The Real Story about Variables, Ids, TyVars, and the like
- Data types and constructors
- The Glorious Renamer
- Hybrid Types
- Checking Types
- Sugar Free: From Haskell To Core
- The Mighty Simplifier
- The Evil Mangler
- Alien Functions
- You Got Control: The STG-language
- The Native Code Generator
- GHCi
- Implementation of `foreign export`
- Compiling and running the Main module

## RTS & Libraries

- Coding Style Guidelines
- Spineless Tagless C
- Primitives
- Prelude Foundations
- Cunning Prelude Code
- On why we have `ForeignPtr`
- Non-blocking I/O for Win32
- Supporting multi-threaded interoperation

## Extensions, or Making a Complicated System More Complicated

- Template Haskell
- Parallel Arrays

## The Source

The online master copy of the Commentary is at

> http://www.cse.unsw.edu.au/~chak/haskell/ghc/comm/

This online version is updated from CVS daily.

Last modified: Thu May 12 19:03:42 EST 2005