• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Run * on the JVM - Simonyi Conference Budapest April 15
 

Run * on the JVM - Simonyi Conference Budapest April 15

on

  • 353 views

 

Statistics

Views

Total Views
353
Views on SlideShare
71
Embed Views
282

Actions

Likes
0
Downloads
2
Comments
0

8 Embeds 282

http://blog.vbalazs.me 248
https://twitter.com 10
http://dev.localtest.me 7
http://feeds.feedburner.com 7
http://blog.localtest.me 5
http://www.slideee.com 3
http://plus.url.google.com 1
http://feedly.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Run * on the JVM - Simonyi Conference Budapest April 15 Run * on the JVM - Simonyi Conference Budapest April 15 Presentation Transcript

    • Run * on the JVM Interpreters on the JVM with Graal and Truffle Balazs Varga / @vbalazs
    • Agenda ● Compiled, interpreted applications and VMs ● Interpreters under the hood ● Interpreter on the JVM ○ Existing solutions ○ Future ● Summary
    • Compiled, interpreted applications Operating system Libraries Compiler Operating system Libraries Executable Machine Code C source code Operating system Libraries InterpreterRuby source code (1.8) GC Libraries compiled C source code (executable machine code) Libraries GC: Garbage Collector
    • Virtual Machines (runtimes) Operating system Libraries Java compiler Operating system Libraries Executable JVM bytecode Java source code Libraries JVM bytecode Java Runtime Env. GC Libraries
    • Interpreters under the hood 1. Tokenize 2. Parse 3. AST Ruby Tokens Abstract Syntax Tree nodes C Machine Language interpret
    • Abstract Syntax Tree function sum(n) { var sum = 0; for (var i = 1; i < n; i++) { sum += i; } return sum; } source: T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, M. Wolczko: One VM to Rule Them All. In Proceedings of Onward!, ACM Press, 2013.
    • Interpreter on the JVM Ruby source code compiled to Java bytecode Operating system Libraries JRuby interpreter Java Runtime Env. GC Libraries Why? Existing solutions
    • The future is here: Truffle and Graal Goal: Native support for interpreters Requirements: ● simplicity ● generality ● performance
    • System structure source: Christian Wimmer and Chris Seaton speak at the JVM Language Summit, July 31, 2013. Ruby Javascript Python R ... Your language here TruffleGraal Language agnostic dynamic compiler Common API between language implementation and optimization system Substrate VM Graal VM
    • Truffle ● Java framework for writing AST interpreters ● node specialization with tree rewriting ● define compiler optimizations, directives ○ assumptions
    • Graal ● 100% Java-based JIT framework ○ JIT: Just In Time (compiler) ● dynamic compiler ● directly control code generation ● graph intermediate representation
    • Node rewrite - optimization source: T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, M. Wolczko: One VM to Rule Them All. In Proceedings of Onward!, ACM Press, 2013.
    • Node rewrite - de- and reoptimization source: T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, M. Wolczko: One VM to Rule Them All. In Proceedings of Onward!, ACM Press, 2013.
    • Bonus “Write your own language!” Before Truffle: ● write a parser and an AST interpreter ● create a runtime system (C/C++), GC ● performance problems: bytecode, JIT, improve GC ● ...??? Easy?
    • Summary ● Truffle, Graal (~ Java 9) ○ “easy” to use AST interpreter framework ○ high performance (compiled to machine code!) ● Bonus: “Write your own language!” ● Contribute! ○ meetup.com: budapest.rb, budapest.js, … ○ https://github.com/jruby/jruby ○ http://openjdk.java.net/
    • Questions?