Slide 1

Slide 1 text

One  VM  to  Rule  Them  All     Aysylu  Greenberg   @aysylu22  h9p://aysy.lu   Papers  We  Love  NYC  #5   June  18th,  2014  

Slide 2

Slide 2 text

About  Me   •  Search  Infrastructure  at   •  Spare  Qme,          +  art  +  archery   •  Love  everything  related  to  compilers  

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Today   •  Introduce  concepts:   – Interpreter,  Compiler   – Just-­‐in-­‐Qme  (JIT)  Compiler,  VM   •  Truffle  +  Graal   •  Node  specializaQon  #FTW   •  Truffle  +  Graal  now  

Slide 5

Slide 5 text

•  Familiar  with  interpreter?  Compiler?  VM?   •  Wrote  interpreter/compiler/VM?   •  Read  the  paper?   •  Played  with  Truffle/Graal?  

Slide 6

Slide 6 text

Interpreter  vs.  Compiler   h9p://www.youtube.com/watch?v=kmQUB-­‐5cEgM    

Slide 7

Slide 7 text

Example  AST  

Slide 8

Slide 8 text

JIT  Compiler       Interpreter  +  Compiler  

Slide 9

Slide 9 text

Virtual  Machine       Interprets  bytecode  for  processor   Targets  ANY  hardware   Easier  to  opQmize  bytecode  

Slide 10

Slide 10 text

Truffle  +  Graal   •  Truffle:  language  implementaQon  framework   •  Graal  VM:  extension  to  HotSpot  VM  with   exposing  of  its  internals  

Slide 11

Slide 11 text

Truffle  +  Graal       Interpreter  for  AST  -­‐>  JIT  Compiler  for  Free!  

Slide 12

Slide 12 text

Node  SpecializaQon  

Slide 13

Slide 13 text

Node  SpecializaQon  

Slide 14

Slide 14 text

Languages  in  Truffle  +  Graal   •  Javascript   •  Ruby   •  Python   •  R   •  J  

Slide 15

Slide 15 text

All  the  Useful  Links  in  One  Place   •  Graal  on  OpenJDK   h9p://openjdk.java.net/projects/graal/   •  TruffleRuby   h9p://blog.jruby.org/2014/01/ truffle_graal_high_performance_backend/   •  FastR   h9ps://bitbucket.org/allr/fastr   •  ZipPy   h9ps://bitbucket.org/ssllab/zippy   •  TruffleSOM   h9ps://github.com/smarr/TruffleSOM  

Slide 16

Slide 16 text

Truffle  +  Graal  Now   •  System  Modularity: h9p://www.slideshare.net/ ThomasWuerthinger/2014-­‐0424-­‐graal-­‐ modularity   •  All  things  Truffle  +  Graal:  h9p://graalvm.org   •  Smalltalk  (SOM)  fastest  implementaQon:   h9p://som-­‐st.github.io/#performance   •  Progress  on  R,  Python,  Ruby,  and  Smalltalk  

Slide 17

Slide 17 text

Truffle  +  Graal  Now   •  New  Truffle  features:   – on-­‐stack-­‐replacement  for  loops   – tail  calls   •  GraalVM  binaries:   h9p://lafo.ssw.uni-­‐linz.ac.at/builds   – Also,  execute  Java  binaries  (faster  for  some   workloads)  

Slide 18

Slide 18 text

And  now  for  Clojurians  …  

Slide 19

Slide 19 text

From  Authors:   “We  are  very  interested  to  build  up  a   Clojure  implementa5on  on  top  of   Truffle.  We  believe  we  would  be  able   to  support  tail  calls.   We  would  be  happy  to  support  kick-­‐ start  any  kind  of  open  source  effort   on  Truffle/Clojure.”