-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
New syntax support, backwards compat cpp for ghcjs #757
Conversation
- Javascript conventions have changed slightly with the GHC Javascript backend (from GHCJS). - See https://github.com/ghcjs/ghcjs-base/pull/135/files. - Update foreign imports to match these new conventions, so compiling with GHC Javascript backend works.
- Update canvas2d to work with new JS backend syntax.
@@ -71,6 +76,22 @@ viewModel Model {..} = view | |||
, div_ [] [ text info ] | |||
] | |||
|
|||
#ifndef ghcjs_HOST_OS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmjio
This is defined both for ghcjs and ghc's js backend.
You want something like this
https://github.com/ghcjs/jsaddle/blob/b72b4d01fdc186d2c7447beb7273ad13358ff593/jsaddle/src/Language/Javascript/JSaddle/Exception.hs#L21-L29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexfmpe where do you see ghcjs_HOST_OS
defined for the new JS backend?
Also, have people on both GHCJS and on >= GHC 9.0.0, so this might explain some issues I was seeing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexfmpe where do you see ghcjs_HOST_OS defined for the new JS backend?
Hmm? AFAICT cabal considers it os(ghcjs)
for both old ghcjs and new js backend https://hackage.haskell.org/package/Cabal-syntax-3.14.1.0/docs/Distribution-System.html#v:Ghcjs
unlike impl(ghcjs)
https://hackage.haskell.org/package/Cabal-syntax-3.14.1.0/docs/Distribution-Compiler.html#v:GHCJS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brings in #740, adds CPP for ghcjs.