SlideShare a Scribd company logo
One 
VM 
To 
Rule 
Them 
All 
Thomas 
Wuerthinger 
@thomaswue 
Oracle 
Labs 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved.
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
2
3 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
3 
Goal:
You 
can 
execute 
any 
language 
on 
the 
JVM 
/ 
CLR 
-­‐ 
as 
long 
as 
it 
looks 
like 
Java 
/ 
C#. 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
4
Prototype 
a 
new 
language 
Parser 
and 
language 
work 
to 
build 
syntax 
tree 
(AST), 
AST 
Interpreter 
People 
complain 
about 
performance 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
5 
Write 
a 
“real” 
VM 
In 
C/C++, 
sXll 
using 
AST 
interpreter, 
spend 
a 
lot 
of 
Xme 
implemenXng 
runXme 
system, 
GC, 
… 
Define 
a 
bytecode 
format 
and 
write 
bytecode 
interpreter 
Performance 
is 
sXll 
bad 
Write 
a 
JIT 
compiler 
Improve 
the 
garbage 
collector
Prototype 
a 
new 
language 
Parser 
and 
language 
work 
to 
build 
syntax 
tree 
(AST), 
AST 
Interpreter 
People 
complain 
about 
performance 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
6 
Write 
a 
“real” 
VM 
In 
C/C++, 
sXll 
using 
AST 
interpreter, 
spend 
a 
lot 
of 
Xme 
implemenXng 
runXme 
system, 
GC, 
… 
People 
start 
using 
it 
Define 
a 
bytecode 
format 
and 
write 
bytecode 
interpreter 
Performance 
is 
sXll 
bad 
Write 
a 
JIT 
compiler 
Improve 
the 
garbage 
collector
Speculate 
and 
OpXmize… 
G 
G 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
7 
U 
U 
U U 
U I 
I I 
G I 
I I 
G 
Node Rewriting 
for Profiling Feedback 
AST Interpreter 
Rewritten Nodes 
AST Interpreter 
Uninitialized Nodes 
Compilation using 
Partial Evaluation 
Compiled Code 
Node Transitions 
S 
U 
I 
D 
String Double 
G 
Uninitialized Integer 
Generic
DeopXmize 
and 
ReopXmize… 
G 
G 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
8 
I 
G 
I I 
G I 
G 
I I 
G 
Deoptimization 
to AST Interpreter 
D 
I D 
G D 
I D 
G 
Node Rewriting to Update 
Profiling Feedback 
Recompilation using 
Partial Evaluation
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Graal 
VM 
• A 
new 
JIT 
compiler 
for 
Java 
wriben 
in 
Java. 
• Designed 
for 
mulX-­‐language 
performance. 
• Downloadable 
from 
the 
Oracle 
Technology 
Network 
(OTN) 
with 
Java 
and 
JavaScript 
support. 
C
Ruby 
R 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
10 
Graal 
Truffle 
Java 
Scala 
JavaScript 
Python 
Smalltalk 
C 
J 
Parallel 
Graph 
AnalyXcs
Written by: Written in: 
Guest Language Application 
Guest Language Implementation 
Host Services 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
11 
OS 
Application 
Developer 
Language 
Developer 
VM Expert 
Guest Language 
Managed Host Language 
Managed Host Language 
or Unmanaged Language 
Unmanaged Language 
(typically C or C++) 
OS Expert
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
Languages 
– 
Special 
Aspects 
• Everything 
is 
a 
map… 
• Everything 
is 
a 
map 
and 
every 
operaXon 
a 
funcXon 
call… 
• Everything 
is 
a 
map 
and 
every 
operaXon 
a 
funcXon 
call 
and 
everything 
is 
a 
vector…
Performance 
– 
Java 
and 
Scala 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
13 
2.5 
2 
1.5 
1 
0.5 
0 
Java 
Scala 
graal 
server 
DaCapo 
benchmarks 
-­‐ 
Normalized 
versus 
client 
compiler
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
14 
7 
6 
5 
4 
3 
2 
1 
0 
Graal/JS 
V8 
Performance 
– 
JavaScript
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
15 
FFI? 
C
Cross-­‐Language 
Inlining 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
16
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
17 
1x! 1x! 
8x! 
11x! 
32x! 
35! 
30! 
25! 
20! 
15! 
10! 
5! 
0! 
MRI! JRuby! Graal/Ruby! MRI + C! Graal/Ruby + 
Graal/C! 
speedup relative to MRI! 
Image Processing Composite Speedup!
High-­‐Performance 
Language 
Interoperability 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
1200 
1000 
800 
600 
400 
200 
0 
Ruby 
data 
JS 
data 
C 
data 
Ruby 
program 
JS 
program 
C 
program 
C 
• Scores 
for 
mixing 
Ruby/JS/C 
execuXng 
the 
scimark 
benchmarks.
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
19 
• Graal 
VM 
Binaries 
for 
Java 
and 
JavaScript 
hbp://www.oracle.com/technetwork/oracle-­‐labs/program-­‐languages 
• Graal 
and 
Truffle 
API 
hbp://openjdk.java.net/projects/graal/ 
• FastR 
hbps://bitbucket.org/allr/fastr 
• TruffleRuby 
hbps://github.com/jruby/jruby/wiki/Truffle 
• ZipPy 
hbps://bitbucket.org/ssllab/zippy 
• Other 
projects 
for 
Smalltalk, 
Clojure, 
Lua, 
…
Safe 
Harbor 
Statement 
The 
preceding 
is 
intended 
to 
provide 
some 
insight 
into 
a 
line 
of 
research 
in 
Oracle 
Labs. 
It 
is 
intended 
for 
informaXon 
purposes 
only, 
and 
may 
not 
be 
incorporated 
into 
any 
contract. 
It 
is 
not 
a 
commitment 
to 
deliver 
any 
material, 
code, 
or 
funcXonality, 
and 
should 
not 
be 
relied 
upon 
in 
making 
purchasing 
decisions. 
The 
development, 
release, 
and 
Xming 
of 
any 
features 
or 
funcXonality 
described 
in 
connecXon 
with 
any 
Oracle 
product 
or 
service 
remains 
at 
the 
sole 
discreXon 
of 
Oracle. 
Any 
views 
expressed 
in 
this 
presentaXon 
are 
my 
own 
and 
do 
not 
necessarily 
reflect 
the 
views 
of 
Oracle. 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
20
Q/A 
@thomaswue 
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved.
Copyright 
© 
2014 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved.
Graal VM: Multi-Language Execution Platform

More Related Content

PDF
Graal and Truffle: Modularity and Separation of Concerns as Cornerstones for ...
PDF
Graal and Truffle: One VM to Rule Them All
PDF
Graal Tutorial at CGO 2015 by Christian Wimmer
PDF
Micro-Benchmarking Considered Harmful
PPTX
JVM++: The Graal VM
PPTX
FOSDEM2016 - Ruby and OMR
PDF
GraalVM - MadridJUG 2019-10-22
PDF
GraalVM - JBCNConf 2019-05-28
Graal and Truffle: Modularity and Separation of Concerns as Cornerstones for ...
Graal and Truffle: One VM to Rule Them All
Graal Tutorial at CGO 2015 by Christian Wimmer
Micro-Benchmarking Considered Harmful
JVM++: The Graal VM
FOSDEM2016 - Ruby and OMR
GraalVM - MadridJUG 2019-10-22
GraalVM - JBCNConf 2019-05-28

What's hot (20)

PDF
GraalVM - OpenSlava 2019-10-18
PPTX
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
PDF
Towards JVM Dynamic Languages Toolchain
PDF
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
PDF
R ext world/ useR! Kiev
PDF
JVM JIT compilation overview by Vladimir Ivanov
PDF
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
PDF
Apache Big Data Europe 2016
PPTX
Python Streaming Pipelines with Beam on Flink
PDF
JVM JIT-compiler overview @ JavaOne Moscow 2013
PPT
Apache Harmony: An Open Innovation
PDF
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
PDF
Eclipse OMR: a modern toolkit for building language runtimes
PDF
Yang in OpenDaylight
PDF
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
PPT
Java Performance Tuning
PDF
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
PDF
KFServing and Feast
PDF
Nashorn in the future (English)
PDF
Functional programming in Scala
GraalVM - OpenSlava 2019-10-18
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Towards JVM Dynamic Languages Toolchain
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
R ext world/ useR! Kiev
JVM JIT compilation overview by Vladimir Ivanov
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Apache Big Data Europe 2016
Python Streaming Pipelines with Beam on Flink
JVM JIT-compiler overview @ JavaOne Moscow 2013
Apache Harmony: An Open Innovation
"JIT compiler overview" @ JEEConf 2013, Kiev, Ukraine
Eclipse OMR: a modern toolkit for building language runtimes
Yang in OpenDaylight
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Java Performance Tuning
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
KFServing and Feast
Nashorn in the future (English)
Functional programming in Scala
Ad

Similar to Graal VM: Multi-Language Execution Platform (20)

PDF
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
PDF
TechEvent Graal(VM) Performance Interoperability
PPTX
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
ODP
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
PDF
PDF
General Capabilities of GraalVM by Oleg Selajev @shelajev
PDF
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
PDF
Javantura v4 - JVM++ The GraalVM - Martin Toshev
PDF
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
PPTX
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
PPTX
Introduction to GraalVM
PDF
GraalVM: Run Programs Faster Everywhere
PDF
Hotspot & AOT
PDF
The need for speed. What is GraalVM? – 4Developers Wrocław 2019
PPTX
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)
PPTX
A tour of Java and the JVM
PDF
GraalVM and Oracle's Documentation Trends.pdf
PDF
Polygot Java EE on the GraalVM
PDF
Graalvm with Groovy and Kotlin - Madrid GUG 2019
PDF
Polyglot Applications with GraalVM
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
TechEvent Graal(VM) Performance Interoperability
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
General Capabilities of GraalVM by Oleg Selajev @shelajev
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Javantura v4 - JVM++ The GraalVM - Martin Toshev
The Java Virtual Machine is Over - The Polyglot VM is here - Marcus Lagergren...
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
Introduction to GraalVM
GraalVM: Run Programs Faster Everywhere
Hotspot & AOT
The need for speed. What is GraalVM? – 4Developers Wrocław 2019
How and why GraalVM is quickly becoming relevant for you (DOAG 2020)
A tour of Java and the JVM
GraalVM and Oracle's Documentation Trends.pdf
Polygot Java EE on the GraalVM
Graalvm with Groovy and Kotlin - Madrid GUG 2019
Polyglot Applications with GraalVM
Ad

Recently uploaded (20)

PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Transform Your Business with a Software ERP System
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Introduction to Artificial Intelligence
PDF
medical staffing services at VALiNTRY
PPTX
Essential Infomation Tech presentation.pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Nekopoi APK 2025 free lastest update
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
AI in Product Development-omnex systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
Transform Your Business with a Software ERP System
Reimagine Home Health with the Power of Agentic AI​
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction to Artificial Intelligence
medical staffing services at VALiNTRY
Essential Infomation Tech presentation.pptx
Wondershare Filmora 15 Crack With Activation Key [2025
wealthsignaloriginal-com-DS-text-... (1).pdf
Design an Analysis of Algorithms II-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Upgrade and Innovation Strategies for SAP ERP Customers
Nekopoi APK 2025 free lastest update
Digital Strategies for Manufacturing Companies
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
AI in Product Development-omnex systems

Graal VM: Multi-Language Execution Platform

  • 1. One VM To Rule Them All Thomas Wuerthinger @thomaswue Oracle Labs Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 2
  • 3. 3 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 3 Goal:
  • 4. You can execute any language on the JVM / CLR -­‐ as long as it looks like Java / C#. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 4
  • 5. Prototype a new language Parser and language work to build syntax tree (AST), AST Interpreter People complain about performance Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 5 Write a “real” VM In C/C++, sXll using AST interpreter, spend a lot of Xme implemenXng runXme system, GC, … Define a bytecode format and write bytecode interpreter Performance is sXll bad Write a JIT compiler Improve the garbage collector
  • 6. Prototype a new language Parser and language work to build syntax tree (AST), AST Interpreter People complain about performance Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 6 Write a “real” VM In C/C++, sXll using AST interpreter, spend a lot of Xme implemenXng runXme system, GC, … People start using it Define a bytecode format and write bytecode interpreter Performance is sXll bad Write a JIT compiler Improve the garbage collector
  • 7. Speculate and OpXmize… G G Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 7 U U U U U I I I G I I I G Node Rewriting for Profiling Feedback AST Interpreter Rewritten Nodes AST Interpreter Uninitialized Nodes Compilation using Partial Evaluation Compiled Code Node Transitions S U I D String Double G Uninitialized Integer Generic
  • 8. DeopXmize and ReopXmize… G G Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 8 I G I I G I G I I G Deoptimization to AST Interpreter D I D G D I D G Node Rewriting to Update Profiling Feedback Recompilation using Partial Evaluation
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Graal VM • A new JIT compiler for Java wriben in Java. • Designed for mulX-­‐language performance. • Downloadable from the Oracle Technology Network (OTN) with Java and JavaScript support. C
  • 10. Ruby R Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 10 Graal Truffle Java Scala JavaScript Python Smalltalk C J Parallel Graph AnalyXcs
  • 11. Written by: Written in: Guest Language Application Guest Language Implementation Host Services Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 11 OS Application Developer Language Developer VM Expert Guest Language Managed Host Language Managed Host Language or Unmanaged Language Unmanaged Language (typically C or C++) OS Expert
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. Languages – Special Aspects • Everything is a map… • Everything is a map and every operaXon a funcXon call… • Everything is a map and every operaXon a funcXon call and everything is a vector…
  • 13. Performance – Java and Scala Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 13 2.5 2 1.5 1 0.5 0 Java Scala graal server DaCapo benchmarks -­‐ Normalized versus client compiler
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 14 7 6 5 4 3 2 1 0 Graal/JS V8 Performance – JavaScript
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 15 FFI? C
  • 16. Cross-­‐Language Inlining Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 16
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 17 1x! 1x! 8x! 11x! 32x! 35! 30! 25! 20! 15! 10! 5! 0! MRI! JRuby! Graal/Ruby! MRI + C! Graal/Ruby + Graal/C! speedup relative to MRI! Image Processing Composite Speedup!
  • 18. High-­‐Performance Language Interoperability Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 1200 1000 800 600 400 200 0 Ruby data JS data C data Ruby program JS program C program C • Scores for mixing Ruby/JS/C execuXng the scimark benchmarks.
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 19 • Graal VM Binaries for Java and JavaScript hbp://www.oracle.com/technetwork/oracle-­‐labs/program-­‐languages • Graal and Truffle API hbp://openjdk.java.net/projects/graal/ • FastR hbps://bitbucket.org/allr/fastr • TruffleRuby hbps://github.com/jruby/jruby/wiki/Truffle • ZipPy hbps://bitbucket.org/ssllab/zippy • Other projects for Smalltalk, Clojure, Lua, …
  • 20. Safe Harbor Statement The preceding is intended to provide some insight into a line of research in Oracle Labs. It is intended for informaXon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcXonality, and should not be relied upon in making purchasing decisions. The development, release, and Xming of any features or funcXonality described in connecXon with any Oracle product or service remains at the sole discreXon of Oracle. Any views expressed in this presentaXon are my own and do not necessarily reflect the views of Oracle. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 20
  • 21. Q/A @thomaswue Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.