How to install ghcjs 8.8 or 8.10?

361 views Asked by At

I would like to produce an HTML / JS page with reflex-dom (only client side, frontend). However, I use the singletons package (2.6) and it seems that it cannot be compiled with ghcjs or ghc 8.6.5 (singletons 2.5.1, broken-unpatched). Therefore, the reflex-platform solutions, reflex-stone or equivalent did not help me.

I saw that ghcjs 8.8 or 8.10 could be installed through haskell.nix, but I did not find how.

How can I do it? Or maybe, is there a way to use GHCJS (or reflex-platform solutions) with recent packages (that need ghc 8.8 or +)? Is there a way to use ghcjs-8.8 or 8.10 with the reflex-platform?

2

There are 2 answers

1
Dmitry Kovriga On BEST ANSWER

First of all I would like to highlight that I'm not in any way related to GHC or GHCJS projects development, just another person who encountered similar issues, so take it with a grain of salt.

Currently GHCJS supports <= 8.6.5 out of the box. There is some development going on now and we will probably see officially supported 8.10 soon.

Meanwhile you can try to build the following branches on your own risk: 8.10 8.8

0
David Fox On

The ghcjs-8.10.7 compiler is in the nixpkgs-unstable branch, so you should be able to nix-build haskell.compiler.ghcjs810. Note that after commit 41f40771488e99c914a3da5de086cf794242c6d7 something happened to make it stop building, I don't know if this has been resolved. But if you rewind to that point your build should work.

Note also that it produces very large and rather slow executables because the optimizer is disabled. Ghcjs-8.6.0.1 is more usable in this respect.