Hacker News new | ask | show | jobs
by azakai 4084 days ago
Not sure we're talking about the same thing. To my knowledge no other ecosystem has anything close to Graal and Truffle at this point, much less "since day 1" of .NET.

The closest thing I can think of is PyPy, which like Graal+Truffle lets you write a dynamic language in a high-level way, but still get specialized JIT compilation "for free". (In PyPy you write an interpreter, in Graal+Truffle it's more declarative.)

Both PyPy and Graal+Truffle achieve state of the art performance. I'm not aware of any dynamic language on .NET coming even close to that.

2 comments

As I understand it, Graal+Truffle is basically the DLR. This has been around since 2008 from Microsoft.

Both IronPython and IronRuby have used this for years.

The "Day 1" comment was specifically pointed at the read-between the lines for Graal, which is basically to create a real IL for Java instead of using the InvokeDynamic semantic that is currently envogue for Scala, Clojure, etc. .NET has had the multi-language one VM paradigm since day one.

No, Graal+Truffle, and PyPy for that matter, are light-years ahead of the DLR. That's why IronPython etc. are nowhere near the state of the art of dynamic language performance, while both the JVM and PyPy have multiple dynamic languages on them that meet that criterion.

The fundamental issue is that dynamic languages need JITs that are very aware of their internals. It's not enough to just emit some code interspersed with PICs and to add fast dynamic dispatch. You also need to speculatively compile and deoptimize in a way that is specific to each dynamic language. Without that, IronPython and other dynamic languages on .NET are often not a little slower but 10x slower than the same languages on the JVM or PyPy.

Graal is a JIT compiler done in Java, it has nothing to do with DLR.

Graal together with SubstractVM offer AOT compilation and is also being used by AMD for the GPGPU support targeted for Java 9, latest Java 10.

Truffle is more of a AST manipulation framework for nodes that can be fed into Graal for compilation.

Then there are those meta-circular JVMs like JikesRVM which are done in Java.

But SubstrateVM, Graal, Truffle, isn't ready for another few years. ( I haven't heard much since 2013.... )
Graal is being used by Project Sumatra (GPGPU) and JRuby.

Sumatra is planned for integration latest by Java 10.

There were a few Java ONE 2014 and JVM Language Summit Presentations.

JRuby: The Hard Parts, Reduction on GPUs, GPU/JVM Cooperation

http://www.oracle.com/technetwork/java/javase/community/jlss...

Ruby on Top of Graal

https://old.parleys.com/share_channel.html#play/543f88bee4b0...

Sumatra OpenJDK Project Update: Parallelize Yourself with the Stream API

https://old.parleys.com/share_channel.html#play/543fa782e4b0...

Clojure doesn't use InvokeDynamic and, AFAIK, has no plans to do so.
SPUR from Microsoft Research demonstrated slightly worse than V8 performance for JavaScript on .NET. Too bad SPUR didn't seem to go anywhere...