Comments (5)
Hi Edmond,
thank you for your request. This is not possible at the moment. Graal JavaScript can be embedded both in JVM and in Node.js. To embedd Node.js (including Graal JavaScript) in the JVM is a whole different task - both are huge native applications that expect to control their environment. We'd need to change quite some Node code to get it working inside a JVM environment.
See #2 for some more explanation.
On the long run, this is definitly interesting and worth looking at. Right now, if you want this combination, you have to start of with a Node.js application and invoke your Java application from there.
Best,
Christian
from graaljs.
@wirthi Thanks for the clarification.
I guess there goes my excitement about true polyglot library interop... I am not the one doing the work so I won't push this but it might not require as big a lift, maybe some kind of java API for builtin nodejs functionality would probably do the trick.
from graaljs.
Something similar has been tried e.g. in Project Avatar. But that's a route we decided not to go, as it will bring all kinds of compatibility problems, and you have to keep up with the fast-moving source base of Node.js. Practically impossible.
With the call as you state it above, you do NOT want to start a new event loop, I guess. What you want to have in most cases is the possibility to submit entries to the (one) Node.js event loop (from Java, or another polyglot language). Such a feature is probably reasonable to provide to language. We are already evaluating options in that area.
from graaljs.
What you want to have in most cases is the possibility to submit entries to the (one) Node.js event loop (from Java, or another polyglot language).
So that would enable java to not simply execute a script, but have something like a long living js daemon that will be able to "send" something to java and vice-versa, right?
from graaljs.
+1 That it would be great if you added support for calling node.js at least once from JVM, even with the event loop cut off.
from graaljs.
Related Issues (20)
- bug with js stack-trace fileName issue HOT 1
- TypeError: (intermediate value).getBytes is not a function HOT 2
- Does java embed runtime support typescript HOT 7
- "import" fails if file extension is not included HOT 2
- Destructuring arrays in arrow function parameters fails HOT 5
- Graal js 22.3.1 broken on armhf big-endian platform HOT 8
- try statement not work correct HOT 1
- operating with java method, the result string is garbled(encoding error) HOT 2
- Performance degradation for indexed string property access HOT 4
- PolyglotContext: console.log doesn't print anything HOT 3
- graalvm calling multi js function HOT 1
- Using ProxyIterable for async iteration HOT 6
- Chrome debugger: Stepping over await operator jumps to end of function HOT 1
- Migrating Nashorn AbstractJSObject HOT 4
- Poor performance of JavaScript source that intensively uses CPU / Memory HOT 2
- PolyglotException when cocatenating String with HashMap HOT 2
- Executing JavaScript IIFE causes PolyglotException: ReferenceError HOT 7
- About CJS loaded code as different Source with multi-context sharing one engine HOT 4
- 'Java.type' - Java is accessible from javascript HOT 3
- Console log returning empty arrays HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graaljs.