Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I learn MacRuby or RubyCocoa [closed]

I am wanting to learn mac development with ruby but I'm not sure which one to go at. RubyCocoa has been around longer but I think MacRuby will beat it out in the long run..

Any suggestions??

like image 729
user73481 Avatar asked Mar 29 '09 20:03

user73481


3 Answers

Go with MacRuby. It's the future :)

It's newer, way faster, and much better integrated. HotCocoa is awesome as well.

MacRuby is a Ruby VM implemented on top of Apple Technologies as opposed to a bridge like RubyCocoa. A Ruby String for example is an NSString by nature, instead of being bridged by the runtime. It's a much cleaner, faster and more solid approach. It's also developed and sponsored by Apple, which means it could become part of OS X at some point.

Also see this post: Why MacRuby Matters

like image 97
Mel Avatar answered Oct 09 '22 00:10

Mel


Since Chuck replied to you, things changed quite a lot, MacRuby now uses LLVM, allows for AOT compilation and is quite stable and much faster than it used to be. The ruby side of things still need some work for be 100% compatible but as I'm writing this response, 0.5 is still in beta and you should see ruby libraries being compatible very quickly.

like image 26
Matt Aimonetti Avatar answered Oct 08 '22 22:10

Matt Aimonetti


RubyCocoa is more mature and better tested. MacRuby is simpler and better designed overall. MacRuby is also about as stable as a lawn chair sitting on a beachball. Seriously. It's definitely the one you want to use in the long run, but it isn't there yet. They're not so different that you'd have to "learn" one versus the other. They're both just Ruby with access to the Cocoa APIs. It's more about knowing the Cocoa APIs than anything else.

I would recommend learning Cocoa with Objective-C. Once you have a good grasp on the central concepts of the framework (which are all based on Objective-C), then you can use Ruby if you still want to.

Update 2011

The above is no longer true of MacRuby. It's very solid and fast enough to do most kinds of Cocoa applications in pure Ruby. The MacRuby team have also gone out of their way to be compatible with pretty much all of the system frameworks, even the C ones. If you like Ruby and want to do Mac development, it's definitely something to consider. There is no reason to choose RubyCocoa anymore unless you need to support ancient versions of OS X or PowerPC (MacRuby is strictly Intel 10.5+). The remaining caveats:

  • Having to include MacRuby.framework in your apps puts a high lower boundary on bundle size (a couple dozen MB for "Hello World" IIRC)

  • Although it's stable in general, it's still very new beta software, so there are a few wrinkles in the less-used corners of the libraries (e.g. Pointers have a few quirks), and some design decisions aren't final (e.g. concurrency support is evolving rapidly)

  • The documentation is still a work in progress, and lags behind the fast-moving language. A lot of articles you'll find about MacRuby suggest that HotCocoa is the cool, native way to make apps — it is a cool experiment, but it is now abandonware with some critical flaws that make it unsuitable for large-scale application development. The standard Xcode toolchain is the supported way to do MacRuby development.

I also still recommend learning Cocoa with Objective-C, just because that's the framework's native language and thus the path of least resistance.

like image 23
Chuck Avatar answered Oct 08 '22 22:10

Chuck