-
Notifications
You must be signed in to change notification settings - Fork 187
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
GHCJS for the JVM #472
Comments
Oh I was planning to answer your question there, but it's been a rather long day. There is some detection of what platform the code is running on: And this is used to exit the process: Defining |
Thank you! After removing the flag |
This is just amazing. 😲 |
See the |
Awesome! It works finally. I have created a pull request here with shims for the JVM. Thank you for your help! |
Hi,
First, thank you all for this cool project! It is really great that Haskell can be compiled to JS and it also enables Haskell running on the JVM via Nashorn, Java's JavaScript engine.
The following program can be compiled with GHCJS and run on the JVM via
jjs
, Nashorn JavaScript runner:It works! As we can see from the above code, we have to define
console.log
as Nashorn doesn't provide one by default. The main issue is that the JVM keeps on running so I had to addsysexit
to terminate the JVM. I looked up GHCJS sources and found this flagGHCJS_TRACE_SCHEDULER
from thread.js. With that flag enabled, I can see that the following lines keep on repeating which seems to be the cause for the JVM not exiting:Any idea how to fix this so that the JVM exits normally? Are there any other things that I need to be aware of to make this work for the JVM?
P.S: Sorry if this is not the right forum to ask these kind of questions. I have also posted this on StackOverflow here but haven't got any answer so far.
The text was updated successfully, but these errors were encountered: