GHC Status Report, October 2014

GHC development is as busy as ever, and 7.10 is going to be no different. Our current release schedule looks like we'd like an RC by Christmas, and a release close to Feburary 2015, which is something of an adjustment based on the 7.8 release. But we've still got plenty planed for all our users, as usual.

However, we still need help with it all. GHC is a community project, and as you may be aware, most of this is done by our wonderful contributors. If you want something done, you should certainly try to get in touch and help make it a reality!

Upcoming plans for the next year

Libraries, source language, type system

  • Applicative is now a superclass of Monad. After much debate, in GHC 7.10, Applicative is finally a superclass of Monad, hence completing the Applicative Monad Proposal.
  • BBP: Foldable/Traversable. As part of the so-called "Burning-Bridges Proposal", the monomorphic definitions in Prelude/Data.List/Control.Monad that conflict with those from Data.Foldable and Data.Traversable have been replaced by their respective ones from Data.Foldable/Data.Traversable. This will be in 7.10
  • Signature sections. Lennart Augustsson is implementing (:: ty) to work the same as (\x -> x :: ty).
  • ApplicativeDo - Now that Applicative is a superclass of Monad, Simon Marlow has plans to implement a new extension for GHC, which will allow do notation to be used in the context of Applicative, not just Monad.
  • Strict language extension. Johan Tibell is working on a -XStrict language extension that will make GHC compile programs in a by-default strict way. Details here.
  • Overloaded record fields - In 2013, Adam Gundry implemented the new -XOverloadedRecordFields extension for GHC, described on the wiki OverloadedRecordFields. We're still aiming to make this part of 7.10, but there's still work to be done!
  • Using an SMT Solver in the type-checker - Iavor Diatchki is working on utilizing an off-the-shelf SMT solver in GHC's constraint solver. Currently, the main focus for this is improved support for reasoning with type-level natural numbers, but it opens the doors to other interesting functionality, such as supported for lifted (i.e., type-level) (&&), and (||), type-level bit-vectors (perhaps this could be used to implement type-level sets of fixed size), and others. This work is happening on branch wip/ext-solver.
  • Kind equality and kind coercions - Richard Eisenberg (with support from Simon PJ and Stephanie Weirich, among others) is implementing a change to the Core language, as described in a recent paper FC. When this work is complete, all types will be promotable to kinds, and all data constructors will be promotable to types. This will include promoting type synonyms and type families. As the details come together, there may be other source language effects, such as the ability to make kind variables explicit. It is not expected for this to be a breaking change -- the change should allow strictly more programs to be accepted.
  • Partial type signatures - Thomas Winant and Dominique Devriese are working on partial type signatures for GHC. A partial type signature is a type signature that can contain wildcards, written as underscores. These wildcards can be types unknown to the programmer or types he doesn't care to annotate. The type checker will use the annotated parts of the partial type signature to type check the program, and infer the types for the wildcards. A wildcard can also occur at the end of the constraints part of a type signature, which indicates that an arbitrary number of extra constraints may be inferred. Whereas -XTypedHoles allow holes in your terms, -XPartialTypeSignatures allow holes in your types. The design as well as a working implementation are currently being simplified PartialTypeSignatures. This will
  • Binary literals (#9224) - Herbert Valerio Riedel implemented the -XBinaryLiterals language extension which finally closes the syntax gap relative to other languages which allow to write base-2 literals such as 0b11001001. This is in GHC 7.10.
  • Propositional equality for GHC.Generics metadata - Gabor Greif is working on a conservative approach to retrofit the metadata types generated by -XDeriveGeneric with a runtime-observable type equality. The feature is discussed under GenericsPropositionalEquality.
  • Backpack module system - Edward Yang is working on extensions to GHC and Cabal to support Backpack. Details in the Backpack wiki page. At the moment, module reexports, the package key infrastructure change, and module thinning and renaming are in GHC HEAD and definitely shipping with 7.10; signatures and Cabal support are coming down the pike. This is in GHC 7.10.
  • More list fusion - Based on a new compiler transformation by Joachim Breitner, CallArity, foldl and related functions now can take part in list fusion. David Feuer then came up with fusion rules for many more functions. This change may not be a unambiguous improvement in all cases, so if you find regressions, we’d like to hear about them. These changes are all in 7.10.

Back-end and runtime system

  • CPU-specific optimizations - Austin Seipp is currently investigating the implementation of CPU-specific optimisations for GHC, including new -march and -mcpu flags to adjust tuning for a particular processor. Right now, there is some preliminary work towards optimizing copies on later Intel machines. There's interest in expanding this further as well.
  • Changes to static closures for faster garbage collection - Edward Yang is working on an overhaul of how static closures represented at runtime to eliminate some expensive memory dereferences in the GC hotpath. The initial results are encouraging: these changes can result in an up to 8% in the runtime of some GC heavy benchmarks, see #8199.
  • New, smaller array type - Johan Tibell has added a new array type, SmallArray#, which uses less memory (2 words) than the Array# type, at the cost of being more expensive to garbage collect for array sizes larger than 128 elements. This is in GHC 7.10.
  • Faster small array allocation - Johan Tibell has made array allocation of arrays of small, statically know size faster by making it inline with the normal heap check, instead of out-of-line in a separate nursery block. This is in GHC 7.10
  • DWARF-based stack tracing - Peter Wortmann and Arash Rouhani (with support from the Simons) are working on enabling GHC to generate and use DWARF debugging information. This should allow us to obtain stack traces and do profiling without the need for instrumentation. The first stages of this work should land in 7.10, but it's not clear if the full feature set will.
  • Reimplemented GMP-based Integer backend (#9281) - Herbert Valerio Riedel is working on this to provide a GMP-based Integer backend not relying on registering GHC-specific custom GMP memory allocators which cause problems when linking to other C-code also using GMP unaware of GHC's memory management.

Frontend, build-system, and miscellaneous changes

  • GHC is now using Submodules for all repositories. For a very long time, GHC has used a mixed method of containing some dependencies as submodules, while others were maintained as floating repositories. Unfortunately, this was a constant source of errors, and made certain things like using git bisect in a robust way impossible. As of GHC now and for the future, all dependent repositories are tracked through git submodule, making them much more robust and reproducible.
  • Phabricator for code review. For the past few months, many GHC developers have been doing something new - public code review! To facilitate that, now runs a copy of Phabricator [PHAB], available at, that we use for continuous integration and code review of incoming patches. Our instance has been tuned to support GHC, and many developers are actively submitting their patches through the queue. This is not only much more robust than trac tickets, it can also do testing of your patches, along with a nifty command line tool for other utilities.


[FC] System FC with Explicit Kind Equality -

Last modified 5 years ago Last modified on Oct 27, 2014 5:09:04 PM