New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHC Plugin in GHCJS? #796
Comments
I'm interested in what all this means and what you can do with this capability. |
GHC's Compiler Plugin mechanism provides a various ways to enhance the way the compiler compiles the Haskell program via GHC API. Users of plugins can simply add a such plugin package to the usual {-# OPTIONS_GHC -fplugin Module.That.Provides.APlugin #-} I usually use them to augment the treatment of GHC's type-level natural numbers and type level literals. These belong to the "Type Checker Plugin" category. Another wonderful example, which belongs to Source Plugin, is |
Follow what @hsyl20 is doing and see at least the long term outlook is very bright :). |
Great! So, both GHC API and Compiler Plugins will eventually be avilable also in ghcjs? Is there any dedicated branch/fork for this topic? |
Aha, I've just found this article by @hsyl20. Thanks! |
Oh, and it states that GHCjs supports Plugins somehow! |
As far as I know, you need to compile a fake Then you also need to compile More details in the note: Line 2 in e87195e
|
@hsyl20 Thanks for the clarification! So, if I maintain a project using ghcjs by Nix and want to use compiler plugins in them, then I must devise some additional scripts to maintain such duplicated situation. |
I am also trying to use plugins in the 8.6 branch. So far, i was able to compile ghc-tcplugins-extra and the cmptype plugin itself with ghc-api-ghcjs. Trying to compile a program that uses the plugin with ghcjs yields an error |
Same problem as @hpacheco, on |
Currently, I'm trying to use some Compiler Plugins such as
ghc-typelits-presburger
andoverloaded
with GHCjs 8.6.But it seems that they failed to find the modules related to GHC API:
TyCoRep
,Type
, etc.It seems that README suggests depending on
ghc-api-ghcjs
instead of ghc; but changing to dependency to it.See my fork of
ghc-tcplugins-extra
for my (failed) attepmt.Is there any way to use Compiler Plugins with GHCJS, or even access to GHC API itself?
The text was updated successfully, but these errors were encountered: