The '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.
[3] is made possible thanks to a variation of the idea called "Futamura projections":
https://en.wikipedia.org/wiki/Partial_evaluation#Futamura_pr...
I 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.
because you wrote Futurama and referred to it so many times in this reply, when I skimmed the thread I read the word in this post and the one above it as Futurama. it took me like 3 re-reads to realize the original did NOT say Futurama.
"Dyslexics of the world, untie!"
Re:GraalVM
by gandalfgeek on Monday August 10, 2020 @01:33PM
(#24111799)
Made 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.
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
[2] https://www.graalvm.org/docs/reference-manual/native-image/
[3] https://www.beyondjava.net/truffle-compiler-compiler
[4] https://github.com/oracle/graal/blob/master/sulong/README.md