Open zarybnicky opened 4 years ago
Also a clue as to whether GHCJS plugins are supported is https://github.com/ghcjs/ghcjs/commit/e36e50ac0c696fb663385fb35094117505e4a805, where I can see 'something' that touches plugins.
I'd assume that the thing to do is to compile the plugins with GHC and pass them through to GHCJS via ghcLibdir
, manually dropping the ghc
(or ghc-tcplugins-extra
or whatever) dependency via callCabal2nix "pkg" src { ghc = null; }
- am I on the right track?
Hi @zarybnicky. I'm also trying to get polysemy-plugin to work with GHCJS, did you discover anything more about this?
@locallycompact No progress to report, no. I did discover that IOHK used to use GHC plugins with GHCJS, but it wasn't a straightforward process and I instead postponed the reflex+polysemy project indefinitely... :man_shrugging: Nowadays, I'd say eff, or one of the effect system alternatives that don't require a plugin would be cleaner - but the ghc-typelits-* plugins are still something desirable.
Polysemy doesn't require the plugin to work, it just saves on type applications, but thanks for trying this and reporting!
I'm trying to use plugins in my Reflex experiments. While I dimly recall reading somewhere that GHCJS doesn't support plugins, that might've been a long time ago as I can't find that information again anywhere, and from reading the Nix files, I got the impression that
Reflex.Optimizer
is usable when compiling with GHCJS as well.In particular I'm having trouble compiling
ghc-tcplugins-extra
due to itsghc
dependency - I did manage to discoverghc-api-ghcjs
by thorough Googling, but patchingghc-tcplugins-extra
to look forghc-api-ghcjs
instead ofghc
doesn't help (Encountered missing dependencies: ghc-api-ghcjs -any
).It seems to me that
ghc-api-ghcjs
is getting compiled with GHC 8.6.4 - the full path to the .so is/nix/store/2cx3p3ywpzz47f23zw3i1ssdjfddjjjw-ghc-api-ghcjs-8.6.5/lib/ghc-8.6.4/x86_64-linux-ghc-8.6.4/libHSghc-api-ghcjs-8.6.5-F0KeWR7UxRl4rynnmWSnQM-ghc8.6.4.so
(note the twoghc-8.6.4
), but I can't find where this is coming from. I'd assume it's theghcjs-ng
machinery inside nixpkgs, but that is as far as I got...I did see that using Reflex.Optimizer with GHCJS adds an extra
ghcLibdir
(ghcLibdir = "${self.ghc.bootPackages.ghcWithPackages (p: [ p.reflex ])}/lib/${self.ghc.bootPackages.ghc.name}";
), but I didn't manage to make it work for other plugins.My ultimate goal is to get
ghc-typelits-knownnat
,ghc-typelits-normalize
, andpolysemy-plugin
working in GHCJS, but that seems a long way off right now...