wiki:Contributing

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.

Bugs:

#8316
GHCi debugger panics when trying force a certain variable
#10346
Cross-module SpecConstr
#11068
Make Generic/Generic1 methods inlinable
#12488
Explicit namespaces doesn't enforce namespaces
#12576
Large Address space is not supported on Windows
#12636
ProfHeap's printf modifiers are incorrect
#13165
Speed up the RTS hash table
#13193
Integer (gmp) performance regression?
#13452
Lock .tix file
#13795
:kind! is not expanding type synonyms anymore
#14899
Significant compilation time regression between 8.4 and HEAD due to coverage checking
#15252
syn_arg_wraps and syn_res_wrap are only populated after typechecking
#15402
The settings and behaviour of idle GC are very confusing
#15540
GHCi does not follow the XDG Base Directory Specification
#15603
ref6 example from StaticPointers documentation doesn't type check
#15660
source file modify race leads to inconsistent error message
#15784
: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
#15820
Document the proposals process in the GHC manual
#15836
ghc-in-ghci script fails when there is a Main.hs in the top-level directory
#15839
DerivingStrategies defaulting warning has no associated enable/suppress flag
#15843
Tuple sections can't be quoted
#15932
DeriveFunctor and GeneralizedNewtypeDeriving instances never reporting as covered
#15935
TYPE is not generated by genprimops
#15963
Test suite should report timeouts as timeouts
#15973
Int used to represent target integer literals
#16167
-ddump-json doesn't work with -e
#16196
Update README.md to reflect gitlab
#16235
Hadrian devel2 builds Haddock
#16273
Hadrian turns on `-Wno-unused-imports` for text when using integer-simple
#16282
all-missed-specializations doesn't suggest warning
#16360
GHC fails when GHC_PACKAGE_PATH contains trailing slash

Feature requests:

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

Tasks:

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

Advice

  • 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 7 months ago Last modified on Jan 4, 2019 12:21:35 AM