25

Hacking on GHC Has Never Been Easier

 4 years ago
source link: https://www.tuicool.com/articles/77Bzqua
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hacking on GHC Has Never Been Easier!

Posted on 22 June 2019

Tags:haskell, nix , programming

At ZuriHac 2019 Matthew Pickering talked about Tools for working on GHC . There’s an associated blog post which is also interesting.

I wanted to focus on a small part of his presentation, which is about loading GHC into GHCi and using ghcid to automatically reload GHC on changes. This has been possible for almost a year now, thanks to work by Michael Sloan .

Putting this together with Alp Mestanogullari’s ghc.nix , it’s now possible to provision a GHC development environment from scratch with just a few commands, assuming that you have nix-shell , cabal-install , and ghcid installed. Here they are:

$ git clone --recursive https://gitlab.haskell.org/ghc/ghc/
$ cd ghc
$ git clone https://github.com/alpmestan/ghc.nix
$ cabal update
$ nix-shell ghc.nix/ --run './boot && ./configure && ghcid'

This will take a while the first time, but ghcid will cache generated artifacts under ./hadrian_ghci so even quitting and reloading will be significantly faster.

Congratulations, you are now a GHC developer!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK