Fork me on GitHub

Wednesday, February 27, 2008

Introduction to Rubinius

I have been working in Ruby and JRuby for quiet some time. MRI is the interpreter I have been using from the beginning for Ruby development. Now that Ruby 1.9 has come out it is really interest.
Rubinius has caught my attention for a while. It has been known to be fast as well as has some of the features which Ruby needs and removes some which Ruby doesn't need.

Though I have not worked with rubinius extensively these are the features in Rubinius I found interesting or needed in Ruby are

1) Rubinius compiles the Ruby code to rbc (Ruby compiled files) files. Ruby compiled files are used to execute there after and so the execution speed is better in Rubinius. Having first worked with python, this was one of the features which I expected by default from Ruby.
2) Rubinius has a method to use archive the source files as Ruby Archives similar to java Jar files which is a very compact way of deployment.
3) Support for concurrency in Erlang actor model. Ruby 1.9 also has this in form of fibers.
4) FFI Foreign Function Interface. Not sure what it means but need to explore more of this.
5) Additional Meta programming capability by MetaClass which is a subclass of Class. Again need to explore more. This features seems interesting as I work a lot on meta programming.
6) Also offers some runtime introspection capabilities.

Rubinius VM is not entirely compatible with MRI code.
For example object#freeze method has been removed. As well multiple assignments like a,b = 1,2 return true and not array of the RHS arguments. This reduced the need to create an array.

So this is what I have read about rubinius till now. Will write a lot more about the practical aspects when I start using it more. Till then happy hacking.

No comments: