Rubinius - A Tool of the Future

10,298 views

Published on

An introduction to the ruby interpreter rubinius, also talks a bit about some of the technical details.

Published in: Technology
  • Be the first to comment

Rubinius - A Tool of the Future

  1. 1. A Tool of the Future aka the road to enlightenment 1
  2. 2. Ask/give questions/comments. Both nice and nasty.
  3. 3. Mantra of rubinius If it can be done in ruby, then it shouldn’t be in C. 3
  4. 4. An idealist is a person who helps other people to be prosperous. Henry Ford
  5. 5. the edges of the sword are life and death no one knows which is which Ikkyū Sōjun
  6. 6. If you’re not failing every now and again, it’s a sign you’re not anything very innovative. Woody Allen
  7. 7. KHAAAAANN! James T. Kirk
  8. 8. • What is (and is not) rubinius? • Who is rubinius? • Features and Goals • Timeline • Technical Details • Demo / Questions 9
  9. 9. http://rubini.us
  10. 10. What. • A brand new ruby engine • Bytecode Virtual Machine based • Generational Garbage Collection 11
  11. 11. Why. • Fun • A desire for a better interpreter 12
  12. 12. Why pt. 2 • Every talk at this conference has mentioned some limitation of ruby. • All limitations are limitations of the current interpreter, not the language. 13
  13. 13. What it’s not. • Vaporware • A thesis project • Finished. 14
  14. 14. Who. • Aki Reijonen (loop) Evan Phoenix (evan) • Mat Elder (mae) Brian Ford (brixen) • John Hornbeck (hornbeck) Wilson Bilkovich (Defiler) • Carsten Bormann (cabo) Pat Eyler (pate) • Devin Walters (defn) Alan Hurdle (hurdlea) • Frederick Ros (sleeper) Thomas Lockney (tlockney) • Alexander Kellet (lypanov) Eero Saynatkai (rue) • Mikko Lehtonen (scoopr) 15
  15. 15. Features and Goals • Remember the Mantra! • VM in C only • Includes primitive operations • Extensive tests and specs • Core library in ruby • Array#dup, Method#new, Object#instance_eval 16
  16. 16. • 1.8.5 compatible • 98% first class • Easy to understand, easy to extend, easy to optimize • MRI (Matz Ruby Interpreter) C API compatible 17
  17. 17. Timeline. • 1.0 by October, 2007 - RubyConf • Near 100% compatible with 1.8.5 • Able to run rails 1.2 • 2.0 • JIT • Optimizers 18
  18. 18. Technical Details • 5 core sections • CPU • Primitives • Compiler • Object Memory / Garbage Collection • Core library 19
  19. 19. CPU • Fully bytecode based • All bytecodes are written test first • Leverage GCC to make help make fast 20
  20. 20. Threads • Currently supports green threads • Contains low level sychronization / sharing mechanism called Channel • A PI Calculus-like channel • Native Thread support in a MxN scheme • (eventually) 21
  21. 21. Primitives • The most basic method • Written C (for now) • Provide most basic functionality 22
  22. 22. Compiler • Completely written in ruby • COMPLETELY WRITTEN IN RUBY • Self bootstrapped from initial rubinius prototype • Pipeline based architecture 23
  23. 23. # rbx sirb -p -s -b sirb(eval):000> puts “hello evan”
  24. 24. puts "hello evan"
  25. 25. [:newline, 1, "(eval)", [:fcall, :puts, [:array, [:str, "hello evan"]]]]
  26. 26. #line 1 push_literal 0 string_dup push self send puts 1 ret
  27. 27. "v

×