

The Architecture of Open Source Applications: The Glasgow Haskell Compiler - dons
http://www.aosabook.org/en/ghc.html

======
reirob
I just read it myself and I must say it gave me a very structured overview of
the GHC architecture as well as some advice and confirmation when programming
in C. Particularly:

(1) "The general principle is: if a program is going to crash, it should crash
as soon, as noisily, and as often as possible. (This quote comes from the GHC
coding style guidelines, and was originally written by Alastair Reid, who
worked on an early version of the RTS.)"

(2) "The code of the RTS is littered with assertions to check these kinds of
things. Assertions are our go-to tool for finding bugs before they manifest;
in fact, when a new invariant is added, we often add the assertion before
writing the code that implements the invariant."

(3) "So, the debug RTS has an optional mode that we call sanity checking.
Sanity checking enables all kinds of expensive assertions, and can make the
program run many times more slowly. In particular, sanity checking runs a full
scan of the heap to check for dangling pointers (amongst other things), before
and after every GC. The first job when investigating a runtime crash is to run
the program with sanity checking turned on; sometimes this will catch the
invariant violation well before the program actually crashes."

This article made me respect the people around Haskell even more.

