GHCJS - working nixpkgs commit? (HLS support?)

About GHCJS:

  1. Can anyone point me to a nixpkgs commit that’s known to successfully compile GHCJS? I tried with a recent nixpkgs-unstable commit and got the error “uncaught exception in Haskell thread: ReferenceError: h$getcwd is not defined”.
  2. Did HLS ever support GHCJS? Just curious if I’m going to have to live without a nice editor experience when writing GHCJS code.

Extra question:

  1. Does someone have tips on locating GHC with JavaScript backend support within nixpkgs (haskellPackages)? (I haven’t yet decided whether to use GHCJS or the new GHC with JS backend. If the latter is available in nixpkgs/haskellPackages, I might want to try that.)

I have some projects in working maintenance mode using GHCJS. Looks like both

and

use d3551b9 from July 2022.

1 Like

Wr.t. hls support: while developing you may want to just use jsaddle and and a recent GHC, and only when you want to actually produce the final javascript code use GHCJS or the GHC javascript backend.

1 Like

Thanks, your commit hash seems to work.

But… to view the updated site (with my updated JS), I need to run GHCJS. So I don’t fully get why you say “only when”. This “only when” is occurring very frequently. :thinking:

I suppose @noinia 's assumption is there is some core behaviour that you can/need to implement in GHC-friendly Haskell, and then focus on the GHCJS output part a bit later.

But maybe you’re at the stage where you only care about the GHCJS part (i.e. some integration with some website DOM/etc); which yeah, in that case, the suggestion isn’t particularly helpful :slight_smile:

FWIW, I think someone has already mentioned this to you, but just in case not; in the past I used Miso to do my GHCJS’ing, and had a pretty good time: GitHub - dmjio/miso: 🍜 A tasty Haskell front-end framework.