Rubinius is Ruby in Ruby

After nearly 4 years of development, the Rubinius Project finally hit a proper 1.0 release earlier this month. Rubinius is an alternative Ruby implementation that is now fully compatible with Ruby 1.8.7 (MRI). While not the only alternative implementation, it's distinguished by the fact that the bytecode compiler is written in pure Ruby (the virtual machine itself is written in C++). Most of the core library is written in Ruby as well, which is pretty neat, and clearly inspired by the self-hosting nature of Lisp compilers. It also presents a perfect opportunity for Rubyists to dig in and learn about how their runtime platform actually works. As of 1.0, you can now run both Rails 2.3.x and 3.x on Rubinius as well as Sinatra and a host of other Ruby web frameworks and toolkits (including any Gem that is written in pure Ruby without native bindings). Like it's cousin JRuby, it features a JIT compiler and also includes a generational garbage collector. In terms of overall performance, Rubinius is making constant improvements. It runs Ruby code very fast, but since much of the core library is written in Ruby rather than C (as it is in MRI), certain benchmarks may run markedly slower. The team continues to improve the JIT, which will result in performance increases as it evolves. They're also actively engaged with the community and contributions are always encouraged. Over 200 developers have participated in the development of the project, led by Evan Phoenix of Engine Yard (interview at InfoQ). Along the way, Rubinius has not only morphed itself into a capable Ruby runtime but has also contributed to other aspects of the Ruby ecosystem, such as introducing the RubySpec executable specification for testing compatibility of different Ruby implementations -- which has since been embraced by MRI, YARV, JRuby, IronRuby, and MagLev. Want to test your own application out on Rubinius? The easiest way to is by using the Ruby Version Manager (RVM), a tool that makes it easy to install and manage a number of different Ruby implementations and versions, as well as Gem sets, on a single machine. Nomadicoder has written a simple set of instructions for getting Rubinius up and running quickly with RVM. Of course, if you want to dive right into the source, it's available on GitHub. And since the majority of Rubinius is written in Ruby itself, it shouldn't be a stretch for the average Ruby developer to grok the code, which of course is the whole point of the affair. If you want to understand how your favorite language is actually implemented, and how dynamic languages can be fast, this is a great place to learn more, especially now that the project itself is a very capable feature-complete runtime.


May 30, 2010
URL:http://www.drdobbs.com/open-source/rubinius-is-ruby-in-ruby/228700696

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.