Version 23 (modified by jhala, 6 years ago) (diff)



GHC Status May 2011

GHC is still busy as ever. The GHC 7.0 branch has come and gone, and now that the branch has been closed we have finally made the long-planned switch from darcs to git. Meanwhile, we are busily working towards the 7.2 branch, and hope to make the 7.2.1 release in June. Some of the forthcoming highlights are:

  • In the autumn, Dimitrios and Simon PJ implemented a completely new constraint solver for the type checker; we also complete an epic JFP paper describing how it works OutsideIn. The new solver is far more tractable and maintainable than the old type checker, and has fixed many outstanding problems. We are still shaking out the last bugs, and we have some nifty ideas for improving performance. Based on this new foundation, we are planning to develop the type system further, notably by adding a richer kind system along the lines of Conor McBride's SHE system SHE.
  • GHC's intermediate language (which we call "Core") is a simple, explicitly-typed lambda in the style of System F. Core is far, far simpler than Haskell (CoreExpr has only eight data constructors), so GHC can type-check Core very fast and reliably. In theory, such a typecheck is redundant (since the original Haskell program was typechecked), but in practice, typechecking Core is a very powerful internal consistency check on GHC itself: many compiler bugs generate type-incorrect Core. This consistency check is run by -dcore-lint.

With the advent of GADTs and type families, the type system of the Core had to grow a little. For a few years we have been using an extension of System F, called System FC, as described in our 2007 paper FC. However, the way that System FC was actually implemented in GHC's Core language was a bit unsatisfactory so, with help from Brent Yorgey, Simon PJ is busy re-engineering it. In particular, FC has coercion terms, and these will now be represented by their own data type Coercion, rather than being squeezed into Type. Moreover, these coercion terms can get big, so there's a new "coercion optimiser" to replace big coercions by equivalent smaller ones. All this is described in our new paper NewFC. These changes will (finally) complete the type-family story by making so-called "equality superclasses" work for the first time in GHC 7.2.

  • Edward Yang has spearheaded a flurry of work on the new code generation backend (-fuse-new-codegen, the rewrite of the part of GHC that turns STG syntax into C--). Hoopl is now fully part of GHC Hoopl, and the new path uses it extensively; we’ve ironed out most of the bugs in the backend; and now we’re working on new optimization passes and fixing inefficiencies to get the generated code as good (or better) than the old code generator. We’re still not at the point where the new code generator will generate better code, but we’re pretty close! Stay tuned.
  • Simon Marlow and Ryan Newton have developed a neat new library for deterministic parallel progarmming in Haskell; read their ICFP submission DetPar. The model is monadic and has explicit control over granularity, but allows dynamic construction of dataflow networks that are scheduled at runtime, while remaining deterministic and pure.
  • Simon Marlow: any update? Previous entry: Simon Marlow is working on a new garbage collector that is designed to improve scaling of parallel programs beyond small numbers of cores, by allowing each processor core to collect its own local heap independently of the other cores. Some encouraging preliminary results were reported in a blog post. Work on this continues; the complexity of the system and the number of interacting design choices means that achieving an implementation that works well in a broad variety of situations is proving to be quite a challenge.

We are fortunate to have a growing team of people willing to roll up their sleeves and help us with GHC. Amongst those who have been active recently are:

  • Mark Lentczner and Dan Knapp have been working on cross-compilation support
  • Continued work on the new I/O manager by Johan Tibbe.
  • Various improvements and build fixes for OS X, from PHO, Greg Wright, Thorkil Naur and William Knop
  • Solaris fixes from Karel Gardas and Christian Maeder
  • Gentoo fixes (for SE Linux and x86 FreeBSD support) from Sergei Trofimovich
  • Other FreeBSD fixes from Marco Silva
  • Linux PowerPC fixes from Erik de Castro Lopo
  • Objective C support has been added by Austin Seipp
  • Documentation updates from Orphi
  • Various improvements from Michal Terepeta
  • General tidyups from Matthias Kilian
  • Primop improvements from Daniel Peebles
  • Some GHCi improvements from Vivian McPhail and Boris Lykah
  • More GHCi debugger fixes from Pepe Iborra
  • LLVM development continues with David Terei
  • Many people have given git help to those of us new to git

At GHC HQ we are having way too much fun; if you wait for us to do something you have to wait a long time. So don't wait; join in!

Other developments

GHC continues to act as an incubator for interesting new language developments. Here's a selection that we know about.

  • Jeff Epstein, in collaboration with Andrew Black, has implemented a library that brings Erlang's programming model to Haskell programmers. In particular, you can write a Haskell program that runs on a cluster of machines that do not share memory. It is all based on a modest but powerful language extension that makes it possible for a programmer to work with "static" functions; that is, ones consisting of pure code with no free variables. The paper that describes all this is called "Haskell for the cloud" Cloud.

  • David Mazieres at Stanford wants to implement Safe Haskell, a flag for GHC that will guarantee that your program does not use unsafePerformIO, foreign calls, RULES, and other stuff stuff.
  • Ranjit Jhala at UC San Diego is working on implementing Liquid Types within GHC. The goal is to allow programmers to use lightweight refinement types to specify key invariants which can then be verified through a combination of type inference and SMT solving.

The Parallel GHC Project

Microsoft Research is funding a 2-year project to develop the real-world use of parallel Haskell. The project is now underway with four industrial partners:

  • Dragonfly (New Zealand)
  • IIJ Innovation Institute Inc. (Japan)
  • Los Alamos National Laboratory (USA)
  • Willow Garage Inc. (USA)

with consulting and engineering support from Well-Typed. Each organisation is working on its own particular project making use of parallel Haskell. The overall goal is to demonstrate successful serious use of parallel Haskell, and along the way to apply engineering effort to any problems with the tools that the organisations might run into.

For more details, see the link:parallel GHC project entry, and the project home page ParallelGhcProject

Data Parallel Haskell

The main user-visible development concerning data-parallel programming with GHC since the last status report is the release of our library for regular, multi-dimensional, shape-polymorphic arrays: Repa. The current release on Hackage performs well with GHC 7.0.3 and already includes Ben's recent work on high-performance stencil-based convolutions — see also the draft paper Stencil and Ben's screencast EdgeDetect of a real-time edge detection application, written in Objective-C and Haskell, using the new Repa library.

We have pushed back the release of a stable version of the main DPH libraries again. They are now scheduled to be released with the forthcoming GHC 7.2.