The Illustrated GHC [pdf]

  • As someone interested in functional programming and compilers, I recently tried to use GHC's intermediate output. However, I got a little disappointed about the documentation that's available for compiler writers. From what is essentially a research compiler, I'd expected a little higher standards, also in the department of available tools, and examples. In other words, the experience came too close to what I would call "hacking".

    Furthermore, the "Core" language is, I believe, for many purposes, more complicated than necessary (e.g., it is typed). It would be nice if there were a simpler alternative, e.g., for small projects.

    Of course, I could be wrong about this (perhaps I looked in the wrong places), but this is just what I noticed.

    Besides this, of course, Haskell is a cool language, and GHC an awesome compiler! :)

  • Fantastic in depth PDF. While lacking the talk (as others have mentioned) I was able to determine in large strokes what's going on at the lower layers of Haskell. I particularly found the FFI interface section (ex. the breakdown of a call to getLine) extremely interesting/useful.

    While I think real understanding will come if/when I have to actually wrestle with the lower layers of GHC (or am contributing to the source code or something), this served as a great overview, and a quick explanation of how Haskell "really" works.

  • This looks great, but needs some interpretation, like an accompanying talk. I got lost in box-and-line diagrams which I did not know how to interpret.

    An introduction to GHC which I found helpful is its AOSA chapter: http://www.aosabook.org/en/ghc.html

  • I haven't looked at the source; is GHC using both C-- (http://www.cminusminus.org/) and LLVM?