Live data from Hacker News

GraalVM: Run Programs Faster Anywhere

graalvm.org

31–40 of 218 posts

Re: GraalVM: Run Programs Faster Anywhere

#31

Truffle makes it possible to implement a JITed dynamically-typed language simply by annotating actions on the AST. http://www.graalvm.org/docs/graalvm-as-a-platform/implement-... Here's an example of the addition operator from Graal's SimpleLanguage: @NodeInfo(shortName = "+") public abstract class SLAddNode extends SLBinaryNode { @Specialization(rewriteOn = ArithmeticException.class) protected long add(long left, lo…

[deleted]

Re: GraalVM: Run Programs Faster Anywhere

#32

Truffle makes it possible to implement a JITed dynamically-typed language simply by annotating actions on the AST. http://www.graalvm.org/docs/graalvm-as-a-platform/implement-... Here's an example of the addition operator from Graal's SimpleLanguage: @NodeInfo(shortName = "+") public abstract class SLAddNode extends SLBinaryNode { @Specialization(rewriteOn = ArithmeticException.class) protected long add(long left, lo…

[deleted]

Re: GraalVM: Run Programs Faster Anywhere

#33

Truffle makes it possible to implement a JITed dynamically-typed language simply by annotating actions on the AST. http://www.graalvm.org/docs/graalvm-as-a-platform/implement-... Here's an example of the addition operator from Graal's SimpleLanguage: @NodeInfo(shortName = "+") public abstract class SLAddNode extends SLBinaryNode { @Specialization(rewriteOn = ArithmeticException.class) protected long add(long left, lo…

Someone I know wrote a Java implementation of the small VM for an open source project that had a simple C interpreter. My first thought was "wait, why?", until they mentioned that it was more than 10x faster and much, much easier to write and extend. You basically get a very good JIT engine for free. Not gonna underestimate Truffle after that.

Re: GraalVM: Run Programs Faster Anywhere

#34

Can someone please explain this? > Are you working on a Java application? Do you want a faster runtime? Enhance your code with JavaScript! First, the JVM already has the Nashorn JS engine. Second, if I'm "working on a Java app", that means that it's already running in a JVM. Where does the faster runtime come from? Is executing JS from Java using Graal faster than running actual Java code? Is it just faster than Nash…

So Graal can do more than Hotspot's C2 compiler so may be able to run your code faster than a stick JVM, Twitter have had some very good experiences with it. The JS implementation is very different to Nashorn's so it may be faster for your application.

Re: GraalVM: Run Programs Faster Anywhere

#35

Can someone please explain this? > Are you working on a Java application? Do you want a faster runtime? Enhance your code with JavaScript! First, the JVM already has the Nashorn JS engine. Second, if I'm "working on a Java app", that means that it's already running in a JVM. Where does the faster runtime come from? Is executing JS from Java using Graal faster than running actual Java code? Is it just faster than Nash…

I think that copy is best read in two parts.

"Are you working on a Java application? Do you want a faster runtime?"

Graal provides an ahead of time compiler for Java, which can speed things up by removing JVM warm up time. I'm unsure how much faster Graal is compared to steady-state JVM.

"Enhance your code with JavaScript!"

Embedding Graal is an alternative to Nashorn.

Re: GraalVM: Run Programs Faster Anywhere

#36

Can someone please explain this? > Are you working on a Java application? Do you want a faster runtime? Enhance your code with JavaScript! First, the JVM already has the Nashorn JS engine. Second, if I'm "working on a Java app", that means that it's already running in a JVM. Where does the faster runtime come from? Is executing JS from Java using Graal faster than running actual Java code? Is it just faster than Nash…

The Graal compiler is compiling Java code to faster machine code on top of the JVM. Also GraalVM's JavaScript implementation uses an entirely different approach by using Truffle for its implementation making it significantly faster. Also GraalVM ships with Node.js support, tooling and other languages.

Here is a full list of reasons: http://www.graalvm.org/docs/why-graal/

Here are some (maybe a bit outdated, but independent) benchmarks comparing it to Nashorn: http://blog.nidi.guru/tech/javascript/2018/04/02/javascript-...

We have some way to go to beat V8.

Re: GraalVM: Run Programs Faster Anywhere

#37
post #33

Truffle makes it possible to implement a JITed dynamically-typed language simply by annotating actions on the AST. http://www.graalvm.org/docs/graalvm-as-a-platform/implement-... Here's an example of the addition operator from Graal's SimpleLanguage: @NodeInfo(shortName = "+") public abstract class SLAddNode extends SLBinaryNode { @Specialization(rewriteOn = ArithmeticException.class) protected long add(long left, lo…

Someone I know wrote a Java implementation of the small VM for an open source project that had a simple C interpreter. My first thought was "wait, why?", until they mentioned that it was more than 10x faster and much, much easier to write and extend. You basically get a very good JIT engine for free. Not gonna underestimate Truffle after that.

Which one was it? Can you remember? One of these?

https://github.com/oracle/graal/blob/master/truffle/docs/Lan...

If not. Please let me know.

Re: GraalVM: Run Programs Faster Anywhere

#38
post #6

We changed the URL from the announcement post at https://blogs.oracle.com/developers/announcing-graalvm . Pretty sure the project page will be better for HN.

I was uncertain which to use and went with the site announcing what was new, even if a bit corporate. I guess I picked wrong. Thanks for fixing.

Re: GraalVM: Run Programs Faster Anywhere

#39
post #33

Earlier quoted context omitted.

Someone I know wrote a Java implementation of the small VM for an open source project that had a simple C interpreter. My first thought was "wait, why?", until they mentioned that it was more than 10x faster and much, much easier to write and extend. You basically get a very good JIT engine for free. Not gonna underestimate Truffle after that.

Which one was it? Can you remember? One of these? https://github.com/oracle/graal/blob/master/truffle/docs/Lan... If not. Please let me know.

It's not listed there, and didn't reach full feature parity (and seems to be dead now).

https://github.com/frodwith/jaque is the project though, which is an implementation of the Nock VM from Urbit

Post reply on HN