Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

MacRuby 0.5 Released: A Significant, Stable Release

By Peter Cooper / February 2, 2010

macruby_logo.pngMacRuby has hit a significant milestone in its development today: version 0.5! The key features include improved HotCocoa support (though this is now maintained separately from core on GitHub), better Ahead-Of-Time (AOT) compilation, and support for OS X 10.6's Grand Central Dispatch.

Give It A Go!

If you've got a Mac and haven't yet tried out MacRuby, give it a go - its speed and general level of support for Ruby is very impressive. You can download MacRuby as a standalone package with installer (for OS X 10.6 and higher) or if you're using RVM, do an update and then rvm install macruby to get the latest nightly build. Matt Aimonetti, of the MacRuby project, reassures us that "MacRuby is namespaced and won’t affect your current Ruby installations" - but RVM is still an option, nonetheless.

Once you give MacRuby a try, check out HotCocoa too (installed with macgem install hotcocoa). It's a library that acts as a "Ruby layer" between Cocoa and MacRuby. Instead of wrestling with Cocoa's classes and verbose method names, HotCocoa wraps up Cocoa in a big, warm blanket of familiar Ruby. Take this very simple "throw a window with a button on the screen" app, for example:

require 'rubygems'
require 'hotcocoa'

include HotCocoa

application do |app|
  win = window :size => [100,50]
  b = button :title => 'Hello'
  b.on_action { puts 'World!' }
  win << b
end

Will the iPad support MacRuby?

Matt says "No." The problem isn't a lack of desire or interest, but that the iPhone OS (also used on the iPad) doesn't do automatic garbage collection or have BridgeSupport support - both of which are needed for MacRuby. Supposedly, though, contributors are looking into ways to circumvent these issues, but I'm more hopeful of GC support in iPhone OS 4.0..

[ruby inside news] Peter here! My next "big thing" is a new site called coder.io. If you're into technologies like Ruby, Git, Python, the iPhone, MySQL, JavaScript, Clojure, etc, you might want to get on the coming sooon list :-) There should hopefully be some freebies/bonuses along with exclusive early access. Thanks!

Comments

  1. Patrick Hernandez says:

    Congratulations to lrz and his team! Currently compiling and installing :-)

  2. Peter Cooper says:

    This release was totally born to be alive.

  3. Ronie Uliana says:

    Hmmmm... Nice! Time to check it out! Congratz!

  4. Tom Bortels says:

    Sweet - macruby is awesomer by the moment. It's wicked fast compared to the stock stuff.

    Small quibble - the hotcocoa source above is slightly borked. The 2nd to last line should read "win << b", with no space between the "<"s.

  5. John says:

    Looks great, time to learn Ruby! ps: sorry to nitpick but I think the last line of the example above should be "win << b" rather than "win < < b". (Obvious to any Ruby programmer, but not to us noobs ;)

  6. Peter Cooper says:

    Thanks for the note - not sure what happened there as I copied and pasted it from a working example on my machine. My syntaxer either threw a wobbly or my fingers did.. :-)

  7. roger says:

    anybody want to throw out a macruby benchmark using sinatra (or what not), for a speed comparison? (and also against rubinius)?

    Also my usual complaint--no linux support?

  8. nate says:

    i should probably look at the docs for this, but will installing this stomp on my existing ruby 1.9.x installed from source under /usr/local/bin?

    i'd like to try this but would need both to coexist. is rvm the best way to manage this?

  9. andrew says:

    Well, it is MACRuby so I wouldn't expect Linx support anytime (soon).

    I'm going to check it out right away :-)

  10. Peter Cooper says:

    nate: It turns into "macruby", "macirb" and "macgem" so probably not :-)

  11. Jacob Atzen says:

    Looks very sweet. Unfortunately I couldn't get it to run under Leopard using rvm:

    installer: Cannot install on volume / because it is disabled.
    installer: This package is only meant for SnowLeopard.

    Would be nice if it didn't try to be clever and just used rvm's way of handling multiple rubies.

  12. Peter Cooper says:

    If you install it with RVM, I believe it does just use RVM's way. At least, that's how it feels when I use it.

    But, yeah, it needs Snow Leopard due to the APIs used.

Other Posts to Enjoy

Twitter Mentions