Zespół badawczy od Oracle'a pracuje nad nowym kompilatorem (z AST do kodu natywnego) oraz odpowiadającym mu frameworkiem (o nazwie Truffle) do szybkiej implementacji języków programowania. Dzięki frameworkowi implementator nowego języka musi jedynie napisać w Javie tłumacza z własnego języka na Truffle AST, a optymalizacją zajmie się tandem Truffle + Graal.
Artykuł: Graal & Truffle
We would want something, some kind of tool or technique, that gave us the following:
- A way to create a new language in just a few weeks
- That ran as fast as the fastest other languages, automatically
- That had high quality debugging support, automatically (ideally without any kind of slowdown)
- That had profiling support, automatically
- That had a high quality garbage collector, automatically … but only if we wanted one
- That could use all the existing code that was out there, no matter what language it was written in
- That supported any style of language, from low level C or FORTRAN to Java to Haskell to extremely dynamic scripting languages like Python and Ruby
- And which could be either just-in-time or ahead-of-time compiled
- And heck, why not, that supports hotswap of code into a running program
- Oh, and we’d want this magic tool to be open source of course. And, er, it should come with a pony. I think that’s it.
Being a smart reader, you of course already guessed that I wouldn’t be writing this article unless such a tool actually did exist. It goes by the bizarre name of Graal & Truffle. Despite sounding like it should be a pretentious hipster restaurant, it is actually a vast research project with over 40 computer scientists from across industry and academia. Together they are building a new set of compiler and virtual machine technologies that implements our wishlist above.
Lista publikacji na stronie projektu: https://github.com/graalvm/graal/blob/master/docs/Publications.md
W prezentacji https://lafo.ssw.uni-linz.ac.at/pub/papers/2016_PLDI_Truffle.pdf jest taki slajd o porównaniu wydajności GraalVMa w stosunku do najszybszych alternatyw (w sensie: jak szybko dany język chodzi na Graalu w porównaniu do najszybszej konkurencyjnej VMki dla tego języka):
Wyniki są chyba jednak trochę przestarzałe, bo powtarzają się w wielu prezentacjach. Mimo wszystko już jest nieźle.
Graala można ściągnąć stąd: http://www.oracle.com/technetwork/oracle-labs/program-languages/overview/index.html
Zawiera nawet taką funkcjonalność jak: node - Drop-in replacement for node.js with Graal.js as the executing JavaScript engine.
Moim zdaniem projekt ma mega potencjał. Nie wiadomo jednak kiedy będzie miał oficjalny status (obecnie jest w fazie rozwoju). Java 9 (która wychodzi za niecałe dwa miesiące) będzie mieć ukrytą pod przełącznikami nową funkcjonalność - możliwość podpięcia Graala jako wtyczki dla HotSpota. Prawdopodobnie w którejś kolejnej wersji Javy GraalVM zostanie zintegrowany z HotSpotem jako kolejny poziom optymalizacji.
Aktualizacja:
Nowa strona GraalVM'a jest pod adresem: https://www.graalvm.org/
- screenshot-20170723180632.png (89 KB) - ściągnięć: 393