Being kinda sick I decided to use the weekend for emptying out my Instapaper account a little. Doing so I finally read Rubinius wants to help YOU make Ruby better on the Engine Yard blog. This reminded me that it’s been over a year since I last looked at Rubinius, so I used the excellent RVM to get the latest version and started my experiments. Basically everything I threw at it just worked, except for some of my scripts using 1.9’s new lambda syntax. Speedwise it seems to be more in the MRI 1.8.7 than the 1.9.2 range, but that’s fair enough. Getting adventurous I decided to try how Rubinius would handle one of my all-time favorite Ruby annoyances, the inability to override to_s in subclasses of String (don’t ask, but this once cost me almost an entire afternoon).
1 2 3 4 5 6 7
In MRI 1.8.7, MRI 1.9.2, JRuby HEAD and MacRuby 0.6 this will output “original”, which I believe to have tracked down to rb_obj_as_string in string.c in the MRI source (no idea about the other implementations). To my great surprise Rubinius 1.0.1 actually output “overriden”, which instantly won it a new fan. :-)