Biweekly update from the GHC DevX team at IOG.
Previous updates can be found here.
JavaScript backend​
- Sylvain: helped fixing support for cross-compilers in GHCup: compilation and installation of a cross-compiler from source and from bindists. Most of the work was done by Julian (GHCup's maintainer). See GHCup#844, GHCup#838, GHCup#845. JS backend support in GHCup can be tested via pre-release channels following instructions in https://github.com/haskell/ghcup-metadata/pull/98#issuecomment-1632214888.
Note that all GHC compilers (including JavaScript and Windows cross-compilers) can be easily used from the Nix environments we provide: see https://github.com/input-output-hk/devx#compilers-and-flavours
Sylvain: implemented support for
rmdir
and fixed some issues withlstat
. GHC!10803Sylvain: refactored and cleaned up the code responsible for converting Haskell types into their JavaScript representation. GHC!10806 and GHC#23314.
Sylvain: fixed a bug in the JS linker that was assuming that the unit-id of a program was always
main
. This is no longer true to support multiple home-units. GHC#23613 and GHC!10819.Sylvain: fixed support for utimes/futimes/lutimes in
unix
library to supporttouchFd
on JavaScript target (to fix Ben's GHC!9237). Not yet merged because it lacks CI (this triggered the work on fixing ghcup). Unix#285.Jeff: Re-enabled the CI perf tests for the JS Backend. These were accidentally disabled because in Josh fixed a bug in the testsuite that treated the JavaScript backend as a Stage1 compiler, which it is. But Stage1 compilers are built with assertions and thus the testsuite does not track performance metrics. The fix changes the JavaScript backend CI to add a debug job and a release job which tracks the performance metrics.
Luite: Looked into some file access failures that caused the JavaScript CI pipeline to fail and found a related issue of platform compatibility, because of mode flags in the
stat
struct. GHC#23651Luite: Looked into CI breakage and found that
emsdk
3.1.42 has some changes in data layout relative to 3.1.41. In particular changes in thestat
struct were causing file operations to fail. CI is fixed now by pinning it to 3.1.40, but work is still ongoing to make sure that we can handle a wideremsdk
version range and to test for a compatible version at installation time. GHC#23649Josh: fixed an issue where
toJSString
didn't support unicode code points that take up more than one UTF-16 value (i.e. values greater than 2^16). See: GHC#23628 GHC!10838Josh: fixed an issue where
Buffer
s inghcjs-base
were producing incorrect results. This was a result of changes between GHCJS and the JavaScript backend:Addr#
is now a pair of(pointer, offset)
and is passed as function arguments- A value was being returned as a
MK_TUP2
, which is a JavaScript macro that expands to apply the Haskell(,)
constructor. This is no longer supported in the JavaScript backend, in favour ofRETURN_UBX_TUP2
, which is another macro that returns multiple values in an unboxed way through the JavaScript RTS.
Josh: added a wiki page to track the support of the JavaScript backend for various libraries. GHC Wiki
Incomplete Record Selectors​
- Bartek: The Incomplete Record Selectors MR is now ready to be merged, See GHC!10736
Deprecated Instances​
- Bartek: A lot of the major work done for the Deprecated Instances, will soon be creating a MR for it
- Bartek: Some investigation of how interface tidying can potentially affect this proposal and the Deprecated Exports proposal, See GHC!10844