Giter Club home page Giter Club logo

Comments (5)

wirthi avatar wirthi commented on May 23, 2024

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.

Devmond avatar Devmond commented on May 23, 2024

@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.

wirthi avatar wirthi commented on May 23, 2024

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.

aindlq avatar aindlq commented on May 23, 2024

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.

anthonyskipper avatar anthonyskipper commented on May 23, 2024

+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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.