4 ms·
If you're interested in looking into some active research in the area of partial evaluation, you should look at Truffle [1] and Graal [2] from my team at Oracle
by nirvdrum 8y ago
If you're interested in looking into some active research in the area of partial evaluation, you should look at Truffle [1] and Graal [2] from my team at Oracle Labs. Graal is a new JIT compiler for HotSpot written in Java, with an API to interact with the compiler from Java. Truffle is a toolkit for implementing programming languages as self-optimizing AST interpreters. Truffle uses the Graal hooks to perform partial evaluation of Truffle-based interpreters to generate highly optimized native code.
The partial evaluator doesn't know anything about the language being compiled, save for a few annotations that Truffle provides to control inline caches and such. We're using this approach to create new optimizing runtimes for Ruby (TruffleRuby), JavaScript (Graal.js), R (FastR), Python (GraalPython), and even LLVM bitcode (Sulong). There are languages being implemented outside of Oracle Labs as well [3]. So, it's being stressed by a wide range of language semantics.
As for performance... I work mostly on TruffleRuby. There we're seeing considerable performance advantages against other Ruby implementations across a wide array of benchmarks and workloads. We really do get the JIT for free by virtue of being a Truffle-based language implementation. It's quite liberating as the compiler technology is free to evolve separately from our Ruby implementation, in contrast to the tight coupling you'd have with a language-specific JIT.
[1] -- https://github.com/oracle/graal/tree/master/truffle https://github.com/oracle/graal/tree/master/truffle
[2] -- https://github.com/oracle/graal/tree/master/compiler https://github.com/oracle/graal/tree/master/compiler
[3] -- https://github.com/oracle/graal/blob/master/truffle/docs/Languages.md https://github.com/oracle/graal/blob/master/truffle/docs/Lan...
- deleted 8y ago[deleted]
- marktangotango 8y agoIsn’t “new” a bit of stretch? That project must be close to 10 years old by now!
- chrisseaton 8y agoGraal has a history going through Maxine, to HotSpot C1. It's been evolving for years, yes, but its application as a partial evaluator only goes back to 2012. TruffleRuby was started in 2013.
- nirvdrum 8y agoFair enough. You could date the project back to the Maxine days as well :-) Joking aside, the Java-Level JVM Compiler Interface [1] was only added about a year ago, in Java 9. This is what allows using Graal with a stock JVM. So, for many people this is the point at which Graal became available. [1] -- http://openjdk.java.net/jeps/243 http://openjdk.java.net/jeps/243