Rubinius
     Use Ruby
Dirkjan Bussink
  http://github.com/dbussink
         @dbussink
1.1 is out!
Let’s have fun
       and write a new
         interpreter!




2006
1.0 by end 2007!




2006
Ok, maybe not...




2007
1.0!




2010
2 virtual machines
2 virtual machines
1.75 garbage collectors
2 virtual machines
1.75 garbage collectors
3 bytecode compilers
2 virtual machines
1.75 garbage collectors
3 bytecode compilers
1 Ruby core library
2 virtual machines
1.75 garbage collectors
3 bytecode compilers
1 Ruby core library
2 primitives systems
2 virtual machines
1.75 garbage collectors
3 bytecode compilers
1 Ruby core library
2 primitives systems
2 JIT compilers
Rubyspec
Ruby in Ruby
module Enumerable
  def collect
    if block_given?
      ary = []
      each { |o| ary << yield(o) }
      ary
    else
      to_a
    end
  end

  alias_method :map, :collect
end
What is Rubinius
 these days?
Compacting generational
   garbage collector
http://www.flickr.com/photos/ell-r-brown
class Address
             attr_reader :street
             attr_reader :number
             attr_reader :city
           end



Address.instance_variable_get("@seen_ivars")
=> [:@street, :@number, :@city]
a          =   Address.new
   a.street   =   "Street"
   a.number   =   "1"
   a.city     =   "Enschede"




Rubinius.memory_size(a) => 56



           VS
Rubinius.memory_size(a) => 160
JIT
InlineCache
module CoolModule
  def method1
    1 + 1
  end
end

class CoolObject
  include CoolModule
end

CoolObject.new.method1
Call counting
def method1
  1 + 1
end

def method2
  method1
end

100.times do
  method2
end
members of rubinius::VMMethod:
total_args = 0,
call_count = 21,
llvm_function_ = 0x0,
name_ = 0x6306,
Go JIT!


  RBX                      LLVM
thread(s)                 thread
            Here it is!
Debugging
DEMO
Profiling
DEMO
Contributing
3 legged dog   turtles        space shuttle   rubinius
                                                Performance
                         26
commit 5386d9299360b5f1ede14392b97da6dc7163ed00
Author: Dirkjan Bussink <d.bussink@gmail.com>
Date:   Tue Jan 8 20:29:01 2008 +0100

     Added Process::POSIX safety checks

diff --git a/kernel/core/process.rb b/kernel/core/process.rb
index fec15b6..ff50b49 100644
--- a/kernel/core/process.rb
+++ b/kernel/core/process.rb
@@ -103,11 +103,15 @@ module Process
   end

    def self.getpgid(pid)
-     Platform::POSIX.getpgid(pid)
+     ret = Platform::POSIX.getpgid(pid)
+     Errno.handle if ret == -1
+     ret
    end

    def self.setpgid(pid, int)
-     Platform::POSIX.setpgid(pid, int)
+     ret = Platform::POSIX.setpgid(pid, int)
+     Errno.handle if ret == -1
+     ret
    end

    @maxgroups = 32
1 patch == commit access
rbx my_awesome_code.rb
Future
1.9
DEMO
So when will you
be a contributor?

Rubinius @ RubyAndRails2010