-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat: Compile grainc to JS & create binaries with pkg #570
Conversation
1f417ab
to
bc5f43b
Compare
@ospencer @peblair I believe this is pretty much ready from the packaging/virtual file system perspective. We just need to figure out the String allocation bug that happens in the JS version of the compiler. I would be forever grateful if either of you could help me debug it. I'll probably be splitting this PR into small stuff that is more related to cleanup of the monorepo, but needed for this stuff to wrap up! |
Awesome work! 🎉 I'll take a look at the allocation stuff. |
0a17f7c
to
1533726
Compare
Is there anything to contribute back to js_of_ocaml ? Better support for unix stubs with node ? |
@hhugo yeah! If you think the unix stubs would be helpful to JSOO, I'm happy to contribute them back! |
exec(file, options, { stdio: "inherit" }); | ||
return file.replace(/\.gr$/, ".gr.wasm"); | ||
} catch (e) { | ||
console.log(e.stdout.toString()); |
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.
@ospencer using stdio: inherit
here instead of explicitly console.logging
process.exit(); | ||
} catch (e) { | ||
console.log(e); |
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.
@ospencer this uses stdio: inherit
already, so we don't need to log the err here.
@ospencer hmm, there seems to be an issue with the lsp mode that I don't quite understand |
aa4a4b1
to
06e9192
Compare
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.
Approved with passing tests!
All my current work to get GrainJS working.
I believe I have some other ideas to actually just compile
grainc
to JS, so I've marked this as draft.