Transcript
Page 1: PWL: One VM to Rule Them All

One  VM  to  Rule  Them  All    

Aysylu  Greenberg  @aysylu22  h9p://aysy.lu  

Papers  We  Love  NYC  #5  June  18th,  2014  

Page 2: PWL: One VM to Rule Them All

About  Me  

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

Page 3: PWL: One VM to Rule Them All
Page 4: PWL: One VM to Rule Them All

Today  

•  Introduce  concepts:  –  Interpreter,  Compiler  –  Just-­‐in-­‐Qme  (JIT)  Compiler,  VM  

•  Truffle  +  Graal  •  Node  specializaQon  #FTW  •  Truffle  +  Graal  now  

Page 5: PWL: One VM to Rule Them All

•  Familiar  with  interpreter?  Compiler?  VM?  

•  Wrote  interpreter/compiler/VM?  

•  Read  the  paper?  

•  Played  with  Truffle/Graal?  

Page 6: PWL: One VM to Rule Them All

Interpreter  vs.  Compiler  

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

Page 7: PWL: One VM to Rule Them All

Example  AST  

Page 8: PWL: One VM to Rule Them All

JIT  Compiler  

   

Interpreter  +  Compiler  

Page 9: PWL: One VM to Rule Them All

Virtual  Machine  

   

Interprets  bytecode  for  processor  Targets  ANY  hardware  

Easier  to  opQmize  bytecode  

Page 10: PWL: One VM to Rule Them All

Truffle  +  Graal  

•  Truffle:  language  implementaQon  framework  

•  Graal  VM:  extension  to  HotSpot  VM  with  exposing  of  its  internals  

Page 11: PWL: One VM to Rule Them All

Truffle  +  Graal  

   

Interpreter  for  AST  -­‐>  JIT  Compiler  for  Free!  

Page 12: PWL: One VM to Rule Them All

Node  SpecializaQon  

Page 13: PWL: One VM to Rule Them All

Node  SpecializaQon  

Page 14: PWL: One VM to Rule Them All

Languages  in  Truffle  +  Graal  

•  Javascript  •  Ruby  •  Python  •  R  •  J  

Page 15: PWL: One VM to Rule Them All

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  

Page 16: PWL: One VM to Rule Them All

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  

Page 17: PWL: One VM to Rule Them All

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)  

Page 18: PWL: One VM to Rule Them All

And  now  for  Clojurians  …  

Page 19: PWL: One VM to Rule Them All

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.”  


Recommended