The Intel labs Haskell research compiler

  • Authors:
  • Hai Liu;Neal Glew;Leaf Petersen;Todd A. Anderson

  • Affiliations:
  • Intel Labs, Hillsboro, OR, USA;Intel Labs, Santa Clara, CA, USA;Intel Labs, Santa Clara, CA, USA;Intel Labs, Hillsboro, OR, USA

  • Venue:
  • Proceedings of the 2013 ACM SIGPLAN symposium on Haskell
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Glasgow Haskell Compiler (GHC) is a well supported optimizing compiler for the Haskell programming language, along with its own extensions to the language and libraries. Haskell's lazy semantics imposes a runtime model which is in general difficult to implement efficiently. GHC achieves good performance across a wide variety of programs via aggressive optimization taking advantage of the lack of side effects, and by targeting a carefully tuned virtual machine. The Intel Labs Haskell Research Compiler uses GHC as a frontend, but provides a new whole-program optimizing backend by compiling the GHC intermediate representation to a relatively generic functional language compilation platform. We found that GHC's external Core language was relatively easy to use, but reusing GHC's libraries and achieving full compatibility were harder. For certain classes of programs, our platform provides substantial performance benefits over GHC alone, performing 2x faster than GHC with the LLVM backend on selected modern performance-oriented benchmarks; for other classes of programs, the benefits of GHC's tuned virtual machine continue to outweigh the benefits of more aggressive whole program optimization. Overall we achieve parity with GHC with the LLVM backend. In this paper, we describe our Haskell compiler stack, its implementation and optimization approach, and present benchmark results comparing it to GHC.