3 ms·
GraalVM consists of a couple of things. 1. A modern JIT compiler written in Java that takes bytecode and transforms it into machine code. There is a plan that
by kasperni 6y ago
GraalVM consists of a couple of things.
1. A modern JIT compiler written in Java that takes bytecode and transforms it into machine code. There is a plan that it might someday replace HotSpot [1]. However, we are probably a couple of years away from this.
2. A native image compiler [2] that uses ahead-of-time compilation technology to produce executable binaries of class files. This means startup times and memory usage similar to a language such as go.
3. An abstract syntax tree interpreter called Truffle. Which allows you to easily implement languages on top of GraalVM. With the performance of compiled languages but using an interpreter. You can read more about this here [3].
There are also other features such as a LLVM bitcode engine called Sulong. And various PolyGlot functionality to support integration of whatever language you want. [4]
[1] https://jaxenter.com/openjdk-project-metropolis-137318.html https://jaxenter.com/openjdk-project-metropolis-137318.html
[2] https://www.graalvm.org/docs/reference-manual/native-image/ https://www.graalvm.org/docs/reference-manual/native-image/
[3] https://www.beyondjava.net/truffle-compiler-compiler https://www.beyondjava.net/truffle-compiler-compiler
[4] https://github.com/oracle/graal/blob/master/sulong/README.md https://github.com/oracle/graal/blob/master/sulong/README.md
- rkangel 6y agoThe 'party trick' combination of (2) and (3) being that you can take a Ruby application, and all of the C extensions that it's using, compile them all AoT and then run whole program optimisation. It was kinda/sorta working a couple of years ago I believe, I don't know what the progress has been.
- nathell 6y ago[3] is made possible thanks to a variation of the idea called "Futamura projections": https://en.wikipedia.org/wiki/Partial_evaluation#Futamura_projections https://en.wikipedia.org/wiki/Partial_evaluation#Futamura_pr...
- rubyfan 6y agoI read that as Futurama and when I clicked through was expecting to see a picture of Fry or Hypnotoad as some time travel concept as inspiration. Even better, when I clicked through I read it the first time and thought “wow cool someone’s last name is Futurama” then I read it again haha.
- gandalfgeek 6y agoMade a short explainer video on how they're using Futamura's ideas of "partial evaluation" to essentially generate an optimizing compiler from just an interpreter. https://youtu.be/vNwA_U4XvfI https://youtu.be/vNwA_U4XvfI