graal + node.js: how does it work?

Adam McMahon adam at cs.miami.edu
Wed Dec 20 03:14:35 UTC 2017


Jaroslav,

Thanks for the info.  Yes, your archetype project might be useful.  Thanks
for the information that you have provided on how graal+node works.  Your
approach seems to be very good, because it does not require a constant
update, assuming that v8.h does not change very often, it should be able to
run the newest node.

My approach, which is really just a proof of concept partially implementing
a few modules, would require me to make more changes as new features are
added to the core of node.  I will be happy to share my code on github once
I get an example together a half-decent example that works well on all 3
systems (node.js, graal+node, node+vertxWrapper).  But in terms of
performance, my approach runs about the same as vert.x (if you are familiar
with that performance), as mine is just a thin call down to vert.x from JS.

Best,

-Adam

On Tue, Dec 19, 2017 at 3:52 AM, Jaroslav Tulach <jaroslav.tulach at oracle.com
> wrote:

> Hello Adam,
> thanks for your interest in graal + node.js. I am maintaining
> https://github.com/graalvm/graal-js-archetype
> archetype. Would you find its approach useful?
>
> On pondělí 18. prosince 2017 22:55:46 CET Adam McMahon wrote:
> > I am interested in learning more about graal + node.js, and I am
> wondering
> > how node.js is integrated into graal/jvm?
> >
> > Can you let me know if the following is about correct?
> >
> > [1] Node.js core was re-written from c++ to java (this seems to be the
> old
> > avatar project??)
>
> No, not at all.
>
> > [2] Graal.js calls into the java implementation of node for the JVM.
>
> Closer.
>
> > Does the above sound correct?
>
> node.js is using v8.h to perform its calls into JavaScript. Jan Štola has
> reimplemented v8.h, so it calls into our (Java based) implementation of
> Graal.js. Except v8.h (and related) the rest of node.js code is
> unmodified. As
> such we believe we can be more compatible than original Avatar.js based
> solution.
>
> > I am interested in how node code can run well on the JVM.  I have a
> partial
> > implementation that I wrote of node.js modules that are a thin JS wrapper
> > on top of vert.x Javasscript.
>
> Nice. Our group would be interested in comparing the speed - our desire is
> to
> make Java/JavaScript/node.js interop fast - faster than any other
> available.
>
> Good luck and let us know your graal+node.js related findings & thoughts.
> -jt
>
>


More information about the graal-dev mailing list