-
Notifications
You must be signed in to change notification settings - Fork 189
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
Missing node.js support from context library #50
Comments
Hi Anthony, can you please clarify what you mean with "a Node.js function". Do you mean an npm module, or Node.js core functionality ("fs.js")? If it is plain JavaScript code with no dependency on Node.js, you can likely load it with Best, |
Hi @wirthi |
Hi @thiagogcm When you start from JVM and not from the
What you can try, however, is to Best, |
It's worth noting that while there is no official support for it from Node.js other applications have successfully embedded node, i.e. so that it can be used as a shared-library without being the entry-point of the application. The obvious example is Electron, but much smaller projects have also managed it such as discussed here and here. I understand that it is outside the focus of the project itself atm, but if someone were to come along who wanted to do this I assume it would be possible to link against node via JNI or whatever and achieve the same effect for Graal.js. |
This issue is a duplicate of #2 |
I found this library https://github.com/apigee/trireme. I'm going to start porting pieces of it under trial (I need net and http initially). Unless someone has a better idea. |
You might also be interested in: |
Thanks @chumer. I don't think Mike's wrapper will work in my case because I'm running trusted and untrusted code together. The nodejvm wrapper appears to be creating a full-access NodeJS thread first under which everything is run. |
I spent the day working through the trireme code and can now see how to port it. Problem is that it's very old (Node version v0.10 - current version is v12) and the differences between these Node versions is quite significant. Porting it isn't a one-man show I think for this reason. |
I had this issue before with Nashorn, and endup using Nodyn's package loader. I created a repo with an example of my approach. You can also see this working in a larger project. I hope this helps someone! |
Hi, Since GraalVM 20.0.0, we have experimental support for common.js require(). Best, |
Original commit message: Merged: [wasm][liftoff] Fix register usage for i64_addi The arm implementation made the assumption that the {lhs} and {dst} registers are either the same, or there is no overlap. This assumption does not hold. ia32 on the other hand has a lot of complicated logic (and unnecessary code generation) for different cases of overlap. This CL fixes the arm issue *and* simplifies the ia32 logic by making the arm assumption hold, and using it to eliminate special handling on ia32. R=thibaudm@chromium.org (cherry picked from commit 89ca48c907e25ef94a135255092c4e150654c4fc) Bug: chromium:1146861 Change-Id: I96c4985fb8ff710b98e009e457444fc8804bce58 No-Try: true No-Presubmit: true No-Tree-Checks: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584242 Reviewed-by: Thibaud Michaud <thibaudm@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/branch-heads/8.6@{#50} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@eddb823 PR-URL: nodejs/node#38275 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
We need the ability to call a node.js function from inside the jvm context library. It would be best if this could be called repeatedly. It is completely ok if Node is orphaned from the greater event loop and has no signal access.
The text was updated successfully, but these errors were encountered: