Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Aysylu Greenberg on One VM to Rule Them All by ...

Aysylu Greenberg on One VM to Rule Them All by Thomas Wuerthinger, Christian Wimmer, et al.

The paper explains how you can write an interpreter and get an optimizing just-in-time (JIT) compiler for free. This enables language designers to focus on features without worrying about the complexities of compiler optimizations and code generation. This paper presents a Java Virtual Machine (JVM) that allows the application to control the JIT compiler behavior at runtime. We'll discuss how various programming languages can take advantage of this framework.

To intrigue compiler aficionados, the authors show how combining AST node rewriting during interpretation, optimization, and deoptimization produces high performance code from the interpreter without a language-specific compiler. In addition, they present how features of a variety of programming languages, such as JavaScript, Ruby, Python, R and others, map on the framework.

Papers_We_Love

July 24, 2014
Tweet

More Decks by Papers_We_Love

Other Decks in Technology

Transcript

  1. One  VM  to  Rule  Them  All     Aysylu  Greenberg

      @aysylu22  h9p://aysy.lu   Papers  We  Love  NYC  #5   June  18th,  2014  
  2. About  Me   •  Search  Infrastructure  at   •  Spare

     Qme,          +  art  +  archery   •  Love  everything  related  to  compilers  
  3. Today   •  Introduce  concepts:   – Interpreter,  Compiler   – Just-­‐in-­‐Qme

     (JIT)  Compiler,  VM   •  Truffle  +  Graal   •  Node  specializaQon  #FTW   •  Truffle  +  Graal  now  
  4. •  Familiar  with  interpreter?  Compiler?  VM?   •  Wrote  interpreter/compiler/VM?

      •  Read  the  paper?   •  Played  with  Truffle/Graal?  
  5. Virtual  Machine       Interprets  bytecode  for  processor  

    Targets  ANY  hardware   Easier  to  opQmize  bytecode  
  6. Truffle  +  Graal   •  Truffle:  language  implementaQon  framework  

    •  Graal  VM:  extension  to  HotSpot  VM  with   exposing  of  its  internals  
  7. Languages  in  Truffle  +  Graal   •  Javascript   • 

    Ruby   •  Python   •  R   •  J  
  8. 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  
  9. 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  
  10. 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)  
  11. 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.”