This is the eighteenth edition of our GHC activities report, which describes the work on GHC and related projects that we are doing at Well-Typed. The current edition covers roughly the months of April and May 2023. You can find the previous editions collected under the ghc-activities-report tag.
Many thanks to our sponsors who make this work possible: Anduril, Hasura, Juspay and GitHub via the Haskell Foundation. In addition, we are grateful to Mercury for funding specific work on improved performance for GHC, HLS and related projects. However, we need more sponsorship to sustain the team! If your company might be able to contribute funding to sustain this work, please read about how you can help or get in touch.
Of course, GHC is a large community effort, and Well-Typed’s contributions are just a small part of this. This report does not aim to give an exhaustive picture of all GHC work that is ongoing, and there are many fantastic features currently being worked on that are omitted here simply because none of us are currently involved in them in any way. Furthermore, the aspects we do mention are still the work of many people. In many cases, we have just been helping with the last few steps of integration. We are immensely grateful to everyone contributing to GHC!
The GHC team at Well-Typed consists of Ben Gamari, Andreas Klebinger, Matthew Pickering, Zubin Duggal, Sam Derbyshire and Rodrigo Mesquita. Moreover, we are delighted that Jaro Reinders will be joining the team for an internship over the next few months. Many others within Well-Typed are contributing to GHC more occasionally.
- Ben prepared and released GHC 9.6.2.
- Zubin prepared and released GHC 9.2.8.
Sam implemented GHC proposal #433 adding
Unsatisfiable. This is an alternative to
TypeError, but with more predictable behaviour, and with a few usability enhancements (such as not being required to manually write out class method definitions in an instance with an
Sam fixed a panic (
ltPSize) in the typechecker, relating to termination checks for superclasses involving type families (#23171).
Matthew minimised a program which exhibited very slow constraint solving (#23158). This problem was subsequently fixed by Simon Peyton Jones in his refactoring of the handling of equality constraints (!10123).
Matthew fixed a bug under which
-Wunused-packageswould sometimes incorrectly warn that
GHC.Primwas unused (!10278).
Sam fixed a variety of panics in the typechecking of invalid newtype declarations involved in recursive groups (#23308).
Sam fixed a bug in which the pattern match checker would not propagate long-distance information in generated code (#23445). In practice, this fixes certain incorrect inexhaustive pattern warnings for pattern matches occurring inside the body of a record update.
Error messages and warnings
Sam finished up work by Soham Chowdhury improving error messages for incorrect import statements (!8895). For example,
import Data.Type.Equality ( (~) )now gives an error message suggesting “Perhaps you meant
type (~),” as opposed to simply saying that
(~)is not in scope.
Sam improved the error messages for ambiguous occurrences, such as mentioning a record field selector when multiple data constructors have a field with that name in scope (!10355).
Sam migrated error messages in
GHC.Tc.Moduleto the new diagnostic infrastructure. In the process, the consistency checks between an
hsigfile and its implementation were tightened up a bit, fixing a couple of shortcomings of validity checking in Backpack (#23342, #23344).
Sam helped two contributors finish their work migrating error messages to the new diagnostic infrastructure. Thanks to Hai Nguyen Quang for handling
GHC.Tc.Validity(!6511) and Gregory Gerasev for handling
Finley enabled compression of info-table provenance entries (IPE). This decreases the size of binaries generated with
-finfo-table-mapby about 20% by using
Matthew identified and fixed a bug with
-fdicts-strictwhich could cause runtime loops when compiling with
Rodrigo updated the documentation of
UnliftedFFIto account for the deprecation of
Ben has been investigating the memory ordering issues observed in #23222 and believes that he has now found the culprit.
Andreas investigated the compatibility of cloning heap objects with the debug runtime system. This surfaced some incompatibilities in the way the debug RTS handles static thunks, which can result in segmentation faults.
Matthew refined the memory retention behaviour to account for pinned and compacted objects. This ensures the RTS doesn’t overestimate how much memory it needs when there are many such objects (#23221).
Ben fixed a bug in the aligned allocation codepath where large alignments could result in overflow of a block (#23400)
Matthew fixed broken links to documentation on the
Matthew added a CI job to create vanilla (non fully-static) alpine binary distributions.
Zubin ensured that we actually test 32-bit GHC binaries when testing the GHCup configuration.
GHC build system
Rodrigo worked on multiple toolchain selection support (#19877), paving the way to a runtime-retargetable GHC. This ongoing work includes numerous patches to how GHC configures and uses toolchains (#23361, !10431, !10513).
Matthew and Rodrigo added unit-id hashes to packages built by Hadrian (!10119). This moves us towards reinstallable boot packages (e.g. a reinstallable
ghclibrary), as it allows us to detect potentially unsound situations (#20742).
haddockwith a response file, in order to avoid over-long line errors on Windows (!10307).
Matthew added an
aarch64job to the
Ben has been moving
head.hackage’s build infrastructure to instead use the excellent
foliagetool, allowing freezing the
head.hackageHackage repository with
Ben has been working with the Core Libraries Committee and other stakeholders to begin disentangling GHC’s internal implementation from the interfaces exposed by
base. See Haskell Foundation Tech Proposal #47.
Ben has been working on introducing infrastructure to more closely test interface stability of
baseand related packages.
The Exception Backtrace Proposal has been accepted by the GHC Steering Committee and the implementation has been brought up-to-date with its text. The proposal is now being discussed with the Core Libraries Committee.
Adam’s meta-proposal to make GHC proposals explicitly consider backwards compatibility was accepted by the GHC Steering Committee.