MacRuby 0.5 Released: A Significant, Stable Release
MacRuby 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!
February 2, 2010 at 12:41 am
Congratulations to lrz and his team! Currently compiling and installing :-)
February 2, 2010 at 12:42 am
This release was totally born to be alive.
February 2, 2010 at 2:21 am
Hmmmm... Nice! Time to check it out! Congratz!
February 2, 2010 at 8:16 am
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.
February 2, 2010 at 9:06 am
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 ;)
February 2, 2010 at 9:48 pm
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.. :-)
February 3, 2010 at 4:54 pm
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?
February 4, 2010 at 3:33 pm
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?
February 4, 2010 at 10:59 pm
Well, it is MACRuby so I wouldn't expect Linx support anytime (soon).
I'm going to check it out right away :-)
February 5, 2010 at 5:10 am
nate: It turns into "macruby", "macirb" and "macgem" so probably not :-)
February 11, 2010 at 9:36 am
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.
February 11, 2010 at 7:41 pm
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.