Contributing to GHC

GHC is a BSD-licensed open-source project, and we welcome your help in making it better. This page and the side bar on the left have pointers to information you'll need.

  • Information for newcomers. This the first stop for those people who say, "I want to contribute to GHC, but I don't know quite where to begin." Begin here.

Working conventions

  • Releases and branches: Our conventions for making releases and how the branches are managed: Releases
  • Useful tools: Various tools which exist to make working on GHC more pleasant.
  • Licensing: make sure you are familiar with GHC's Licensing. Unless you say otherwise, we will assume that if you submit a contribution to GHC, then you intend to supply it to us under the same license as the existing code. However, we do not ask for copyright attribution; you retain copyright on any contributions you make, so feel free to add your copyright to the top of any file in which you make non-trivial changes.

Tips and Tricks

  • To have an easier time looking up tickets and searching trac, use the browser tips page to make your search and lookups for Trac tickets substantially easier.
  • If you use Emacs, see Emacs for some useful stuff to put in your .emacs file.

Newcomers to GHC

While the building guide, working conventions, commentary and debugging pages (always linked from the left sidebar) have great information that can come in handy while you're working on your first, or first several patches, this section is intended to have the details you will need to get rolling.

If you have any questions along the way don't hesitate to reach out to the community. There are people on the mailing lists and IRC who will gladly help you (although you may need to be patient). Don't forget that all GHC developers are still learning; your question is never too silly to ask.

First steps

  • While you are waiting for your build to finish, orient yourself to the general architecture of GHC. This article is written by two of the chief architects of GHC, Simon Marlow and Simon Peyton-Jones, is excellent and current (2012).
  • After a successful build, you should have your brand new compiler in ./inplace/bin/ghc-stage2. (GHCi is launched with ./inplace/bin/ghc-stage2 --interactive). Try it out.

Finding a ticket

Now that you can build GHC, let's get hacking. But first, you'll need to identify a goal. GHC's Trac tickets are a great place to find starting points. You are encouraged to ask for a starting point on IRC or the ghc-devs mailing list. There someone familiar with the process can help you find a ticket that matches your expertise and help you when you get stuck.

If you want to get a taste for possible starting tasks, below is a list of tickets that appear to be "low-hanging fruit" -- things that might be reasonable for a newcomer to GHC hacking. Of course, we can't ever be sure of how hard a task is before doing it, so apologies if one of these is too hard.

You can add tickets to this list by giving them the newcomer Trac keyword.


GHCi debugger panics when trying force a certain variable
Cross-module SpecConstr
Make Generic/Generic1 methods inlinable
Explicit namespaces doesn't enforce namespaces
Large Address space is not supported on Windows
ProfHeap's printf modifiers are incorrect
Speed up the RTS hash table
Integer (gmp) performance regression?
Lock .tix file
:kind! is not expanding type synonyms anymore
Significant compilation time regression between 8.4 and HEAD due to coverage checking
syn_arg_wraps and syn_res_wrap are only populated after typechecking
The settings and behaviour of idle GC are very confusing
GHCi does not follow the XDG Base Directory Specification
ref6 example from StaticPointers documentation doesn't type check
source file modify race leads to inconsistent error message
:doc shouldn't report <has no documentation> for a data constructor when it can show docs for the type constructor of the same name and type
Document the proposals process in the GHC manual
ghc-in-ghci script fails when there is a Main.hs in the top-level directory
DerivingStrategies defaulting warning has no associated enable/suppress flag
Tuple sections can't be quoted
DeriveFunctor and GeneralizedNewtypeDeriving instances never reporting as covered
TYPE is not generated by genprimops
Test suite should report timeouts as timeouts
Int used to represent target integer literals
-ddump-json doesn't work with -e
Update to reflect gitlab
Hadrian devel2 builds Haddock
Hadrian turns on `-Wno-unused-imports` for text when using integer-simple
all-missed-specializations doesn't suggest warning
GHC fails when GHC_PACKAGE_PATH contains trailing slash

Feature requests:

Give more detailed information about PINNED data in a heap profile
Type family patterns should support as-patterns.
Allow inline pragmas on pattern synonyms
Missed constant folding oportunities
Machine accessible interface to GHCi
ghc -M requires -dep-suffix for no good reason
Pattern Synonym for Ratio
Provide bitreverse primop


Better inlining test in CoreUnfold
Make the runtime reflection API for names, modules, locations more systematic
Remove IEThingAll constructor from IE datatype
Allow users guide to be built independently from GHC
Add a flag to control constraint solving trace
Cleanup GHC verbosity flags
Add a more complete example for the special SPEC argument to the user guide
Add some benchmarks to nofib from Andras Kovac's Eff benchmarks
Add a suppression flag to stop Typeable bindings being emitted with -ddump-simpl
Split up glasgow_exts.rst
Document fundeps
Check if some auto apply code is dead and remove if appropriate.
Implement more constant folding for Naturals
Explore whether adding XRay attributes to LLVM IR is worthwhile
Core optimizations for memset on a small range
Improve -dynamic-too progress messages
Make -threaded the default
Make JUnit report stdout/stderr in more cases


  • Need help? You can email the ghc-devs list, or ask on IRC in #ghc.
  • Don't get scared. GHC is a big codebase, but it makes sense when you stare at it long enough!
  • Don't hesitate to ask questions. We have all been beginners at some point and understand that diving in to GHC can be a challenge. Asking questions will help you make better use of your hacking time.
  • Be forewarned that many pages on the GHC Wiki are somewhat out-of-date. Always check the last modification date. Email ghc-devs if you're not sure.
  • There is a blog post series by Stephen Diehl that provides an overview of many important data structures and contains links to other sources of information: Dive into GHC

Happy hacking!

Last modified 11 months ago Last modified on Jan 4, 2019 12:21:35 AM