Skip to main content

IOG GHC Update #33

ยท 3 min read

Triweekly update from the GHC DevX team at IOG.

Previous updates can be found here.

High-level Summaryโ€‹

The team is continuing the work on characterizing and upstreaming some GHC patches that are only present in haskell.nix-provided GHCs. Other work has been done to prepare for the GHC 9.12 fork in September.

Detailsโ€‹

Jeff: triaged all haskell.nix patches to decide which should be upstreamed.

Sylvain: fixed CI of his haskus-utils-variant package that is used by ghcup and that was causing build failure in nixpkgs. In the process I've fixed an issue in doctests about error links produced by GHC 9.10 doctest#448.

Sylvain: encountered and fixed an issue where GHC would pick the wrong ghcversion.h file which defines CPP constants such as __GLASGOW_HASKELL__ (GHC version used). As a result some CPP conditionals were incorrectly evaluated for the GHC version used and some packages failed to build. cabal#10229 GHC#25106 GHC!13070

Sylvain: fixed documentation in GHC's users guide about JS callbacks. GHC#24377 GHC!13119

Sylvain: removed hack used in GHC's rts to support old versions of Cabal. The hack consisted in always linking with a compiled .c file in order to force cabal to create a library otherwise only composed of .js files. The hack is no longer needed since GHC used a more recent Cabal now. GHC#25138 GHC!13106

Luite: Worked on improving locking for the GHC external interpreter (iserv and ghc-interp.js) to fix problems with -j GHC#25083

Luite: Looking into making the Windows toolchain choices more flexible, allowing gcc and msvcrt instead of just clang/ucrt.

Sylvain: fixed a bug with 64-bit literals compiled with a 32-bit compiler that were truncated. The current fix is only temporary as it disables some optimizations for 64-bit literals when compiled with a 32-bit compiler. A proper fix is still in the making and will be much more invasive and difficult to backport. GHC#24893 GHC!13096. The ticket tracking the proper fix is GHC#25151

Sylvain: adapted a patch from haskell.nix to support AARCH64_R_NONE relocations in the RTS linker GHC!13113

Sylvain: wrote about GHC's stability and support mutable fields in data constructors

Sylvain: done some refactoring of the linker code GHC!13136 and GHC!13142

Jeff: Attempted to convert GHC's Word64Set to a bitmap for more efficient memory representations. This is a follow on from GHC!12687. Unfortunately, this won't work in GHC because GHC uses the top 8 most significant bits of a Unique to tag information about the Unique. Next step is to implement a roaring bitmap instead.

Jeff: Experimented with a more memory efficient LambdaFormInfo (GHC!13131) inspired by some data-oriented programming techniques. Initial results were quite good: ~ 1% allocation improvement in many cases but not all. This was just a shot in the dark, next step here is to apply similar techniques but to data types that we empirically know are hot loops in the compiler.