Papers related to GHC
Here we've collected together lots of documentation and papers that generally describe stuff we've implemented in GHC.
Many of these papers are old. For more up-to-date ones look on:
All docs are gzipped A4 Postscript unless otherwise specified.
- An External Representation for the GHC Core Language. This document describes the syntax of GHC Core (.hcr) files, which can be used to feed GHC intermediate code to other (non-GHC) back-end processors.
- Haskell Execution Platform design document. This document describes the design for an integrated compiler/interpreter API for executing Haskell programs, which forms the heart of the combined Hugs/GHC system.
-  A semantics for imprecise exceptions describes how exceptions work in GHC. A follow-up paper is Imprecise Exceptions, Co-Inductively
-  Lightweight Extensible Records for Haskell. This design is not implemented.
-  Derivable Type Classes. Fully implemented in GHC.
-  Pattern Guards and Transformational Patterns. This isn't implemented, but a related idea, called view patterns is.
-  Unboxed Values as First-Class Citizens. Fully implemented.
Types and typechecking
-  GHC's typechecker implementation is described in the paper Type classes in Haskell, CV Hall, K Hammond, SL Peyton Jones, and PL Wadler, European Symposium On Programming, LNCS 788, Springer Verlag, pp. 241-256, April 1994.
-  The UsageSP analysis is described in Keith Wansbrough and Simon Peyton Jones, Once Upon a Polymorphic Type, Technical Report TR-1998-19, Department of Computing Science, University of Glasgow, 1998. Conference version Once Upon a Polymorphic Type, in The Twenty-sixth ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 20-22, 1999, San Antonio, Texas. This work isn't in GHC.
The innards of the complier
- Implementing lazy functional languages on stock hardware: the Spineless Tagless G-Machine. This paper describes the execution model used by GHC. It is most relevant to GHC up to version 3.xx---in version 4 we made some changes which are described in the RTS document.
-  Secrets of the GHC inliner is still highly relevant; it is still a more-or-less accurate description of GHC's "simplifier".
-  The Glasgow Haskell Compiler - a Technical Overview - from 1992, not entirely relevant any more.
- Adding an Optimisation Pass to the Glasgow Haskell Compiler (Olaf Chitil). Somewhat out of date.
- Run-time System document. This document (is supposed to) describe the new run-time system in GHC 4.xx. Be warned that the implementation and this document are evolving in parallel, so they might not be quite in sync.
-  Non-stop Haskell the workings of an incremental garbage collecton. Not included in GHC, so far.
The awkward squad: I/O, concurrency, exceptions, and foreign functions
- The Concurrent Haskell Foreign Function Interface. This document is a draft Haskell addendum that describes GHC's approach to concurrency and its interaction with the FFI and OS threads.
-  Asynchronous Exceptions in Haskell. The ideas here are fully implemented in GHC.
-  Concurrent Haskell. The original paper about Concurrent Haskell, fully implemented.
-  Imperative Functional Programming. The original introduction of monads for I/O and state in Haskell, this paper won a 10-year impact award for POPL. A follow-up paper is Lazy Functional State Threads
- Time and Space Profiling for non-strict, higher-order functional programs. Fully implemented.