Closed DrewFenwick closed 7 months ago
Yes GHCJS isn't being developed anymore, and the GHC JavaScript backend has seen lots of cleanup and fixes, but we haven't quite reached complete feature parity yet.
We can still use the os
and arch
conditionals to check for the JavaScript target in cabal. I think checks for GHC vs GHCJS can be done with version number checks. GHC 9.6 hasn't been supported by GHCJS. Also GHCJS used to define the __GHCJS__
macro, so if that's not defined we're dealing with the GHC backend instead.
Some ghcjs-prim
functionality is now part of base
, but ghcjs-base
might still be needed. @JoshMeredith has recently been working on GHC support for that package: https://github.com/JoshMeredith/ghcjs-base/tree/hsyl20/js-backend
ghcjs-base, jsaddle and ghcjs-dom have been updated in hackage now
If I understand correctly, GHC's new Javascript backend is basically merging the work of GHCJS into GHC proper and as such, GHCJS is dead, long live GHC Javascript backend.
If so JSaddle should be ported to work with GHC's javascript backend. Building under GHC's Javascript backend should set
System.Info.arch
tojavascript
and make the CPP macrojavascript_HOST_ARCH
defined, so the existing conditional compilation should be adaptable.I'm uncertain how to verify that the compiler is in fact GHC since at the moment, GHCup installed versions of GHC Javascript backend are called the lovely name of
javascript-unknown-ghcjs-ghc
, so I assume the cabal conditionimpl(ghc)
wouldn't work.As I understand it, the contents of
ghcjs-base
have now become part ofbase
proper, so the there should need to be even less cabal conditionals, but I assume conditional compilation is still needed inside the actual Haskell modules.