The architecture of the Utrecht Haskell compiler

In this paper we describe the architecture of the Utrecht Haskell Compiler (UHC). UHC is a new Haskell compiler, that supports most (but not all) Haskell 98 features, plus some experimental extensions. It targets multiple backends, including a bytecode interpreter backend and a whole-program analysis backend, both via C. The implementation is rigorously organized as stepwise transformations through some explicit intermediate languages. The tree walks of all transformations are expressed as an algebra, with the aid of an Attribute Grammar based preprocessor. The compiler is just one materialization of a framework that supports experimentation with language variants, thanks to an aspect-oriented internal organization.

[1]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[2]  Hans-Juergen Boehm,et al.  Garbage collection in an uncooperative environment , 1988, Softw. Pract. Exp..

[3]  Donald E. Knuth,et al.  Literate Programming , 1984, Comput. J..

[4]  Simon L. Peyton Jones,et al.  Types are calling conventions , 2009, Haskell.

[5]  Simon L. Peyton Jones,et al.  Compiling Haskell by Program Transformation: A Report from the Trenches , 1996, ESOP.

[6]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[7]  S. Doaitse Swierstra,et al.  The Structure of the Essential Haskell Compiler, or Coping with Compiler Complexity , 2007, IFL.

[8]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[9]  S. Doaitse Swierstra,et al.  Ruler: Programming Type Rules , 2006, FLOPS.

[10]  Erik Poll,et al.  Algebra of Programming by Richard Bird and Oege de Moor, Prentice Hall, 1996 (dated 1997). , 1999 .

[11]  Simon Peyton Jones,et al.  Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell , 2005 .

[12]  Stephen Tse,et al.  Typed Intermediate Languages , 2004 .

[13]  Mark P. Jones,et al.  Typing Haskell in Haskell , 1999 .

[14]  Eelco Visser,et al.  Stratego: A Language for Program Transformation Based on Rewriting Strategies , 2001, RTA.

[15]  João Saraiva,et al.  Designing and Implementing Combinator Languages , 1998, Advanced Functional Programming.

[16]  Daan Leijen,et al.  Helium, for learning Haskell , 2003, Haskell '03.

[17]  Simon Peyton-Jones,et al.  Henk: A Typed Intermediate Language , 1997 .

[18]  Simon Peyton Jones,et al.  Henk: a typed intermediate language , 1997 .

[19]  S. Doaitse Swierstra,et al.  Attribute grammars fly first-class: how to do aspect oriented programming in Haskell , 2009, ICFP.

[20]  Urban Boquist,et al.  Code Optimisation Techniques for Lazy Functional Languages , 1999 .

[21]  Karl-Filip Faxén,et al.  A static semantics for Haskell , 2002, Journal of Functional Programming.

[22]  S. Doaitse Swierstra,et al.  Abstract Interpretation of Functional Programs using an Attribute Grammar System , 2009, Electron. Notes Theor. Comput. Sci..

[23]  Simon L. Peyton Jones,et al.  Secrets of the Glasgow Haskell Compiler inliner , 2002, Journal of Functional Programming.

[24]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[25]  Thomas Johnsson,et al.  The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages , 1996, Implementation of Functional Languages.

[26]  Simon Peyton Jones,et al.  The New GHC/Hugs Runtime System , 1998 .

[27]  Richard S. Bird Using circular programs to eliminate multiple traversals of data , 2004, Acta Informatica.

[28]  Atze Dijkstra Stepping through Haskell , 2000 .

[29]  Simon L. Peyton Jones,et al.  Scrap your boilerplate: a practical design pattern for generic programming , 2003, TLDI '03.