1

The HotSpot JVM team is developing the extremely cool project Graal/Truffle, which allows developers to dynamically compile/inject Java, Javascript (and others) to run at JVM speed. Questions: - Is OpenJ9 interoperable with Graal/Truffle? - If OMR is similar to Graal/Truffle can you contrast them?

eregon
  • 1,486
  • 14
  • 15
Hristo Stoyanov
  • 1,508
  • 3
  • 15
  • 24

2 Answers2

2

Some information on support for Truffle API is here: https://github.com/eclipse/openj9/issues/59

Ashutosh
  • 181
  • 5
1

Comparisons between OMR and Graal have been written here: https://github.com/eclipse/omr/issues/1118

Quoting John Duimovich from that issue:

So, the short answer is that Truffle/Graal is research effort that is looking at using the JVM for implementing programming languages. Truffle is used to implement languages via implementing an AST parser and optimizing it via Graal (lots of details skipped). Graal focuses on code generation and relies on Java for garbage collection. You implement your language in Java. As many of the target languages use C/C++ as their implementation language, this could be a non-starter, but perhaps with TruffleC it could be used to re-compile directly but I don't think that is open source. They have some impressive benchmarks so there is cool stuff there.

and

Eclipse OMR, is production ready code, used by IBM Java, and trying to bootstrap into other languages, has good benchmarks in Java, but for other languages proof points are still in progress as OMR is about 1 year old as an open source project. An existing language implementer, would not need to re-write their C/C++ implementation so they could incrementally adopt components. If you want a code gen library to integrate, or a separate GC implementation to integrate, you would pick OMR as they are provided as modular components.

There is also prototypes that allow Java code to drive OMR's JITBuilder code generator from Java. See JVMLS presentation from Mark Stoodley: https://www.youtube.com/watch?v=w5rcBiOHrB0

Dan Heidinga
  • 489
  • 2
  • 11
  • > As many of the target languages use C/C++ as their implementation language, this could be a non-starter. Not really. You can still invoke C code via e.g. JNI and there is GraalLLVM[1] (code name sulong), which let's you run C/C++/Fortran inside JVM (it's interpreted as any other Truffle language). See FastR or TruffleRuby, which are using this to run R/Ruby native extensions. [1] https://github.com/graalvm/sulong – Steves Feb 19 '18 at 10:29
  • ...of course if you want to port the existing implementation that may be a problem, but at the same time you're not going to get any benefits unless you adopt that implementation to what ORM/Truffle offers. – Steves Feb 19 '18 at 10:47