MacRuby 0.5 Beta 2: AOT Compilation, Rack & Sinatra Support, And More

By Peter Cooper

MacRuby, a port of Ruby 1.9 to the Mac OS X Objective C common runtime, is today one step closer to a production-ready Ruby implementation with the release of beta 2 of MacRuby 0.5. MacRuby 0.5 has been highly anticipated since it was first mentioned back in March because it promises significant performance improvements, a new LLVM based virtual machine (replacing YARV), and significant compatibility improvements and bug fixes. Even still at this beta stage, 0.5 delivers on these promises.

New in MacRuby 0.5 so far:

rdoc and ri now work - thanks to compatibility bug fixes

Rack and Sinatra support

Experimental support for BigDecimal, OpenSSL, and JSON extensions

Compiler with support for building fat binaries (i.e. universal binaries)

An all new LLVM based VM

A gazillion bug fixes and performance improvements - as always!

At this stage, the MacRuby team want people to download MacRuby, give it a test, and report any bugs or issues encountered. If you're on OS X, don't be worried about installing it. It comes in a simple installer package and presents itself through the macruby and macirb binaries, so it doesn't clash with any existing Ruby implementations installed on your machine.

For me, perhaps the most exciting developments are the macrubyc compiler and macruby_deploy utility. In a basic benchmark I performed, compiling a Ruby script that does a Fannkuch benchmark yielded a 20% speed increase with MacRuby 0.5b2. Impressive, as the baseline interpreted version was on par with MRI 1.9.1 already! The macruby_deploy utility is a new addition to help you deploy your MacRuby applications as regular OS X apps. It puts the MacRuby framework along with your script's executable into an application bundle ready to be deployed to any other Mac - even those without MacRuby.

[ad] Find duplication, code smells, complex code and more in your Ruby code with Caliper! The metrics are free and setup takes just one click. Get started!