Hacker News new | past | comments | ask | show | jobs | submit login
MacRuby 0.6 Released (macosforge.org)
32 points by twobar on April 30, 2010 | hide | past | favorite | 13 comments



> In MacRuby, all Ruby classes and objects are actually Objective-C classes and objects. There is no need to create costly proxies, convert objects, and cache instances. A Ruby object can be cast (toll-free) at the C level as an Objective-C object. The Ruby VM can also handle incoming Objective-C objects without conversion.

> In MacRuby, the primitive Ruby classes (e.g., String, Array, and Hash) have been re-implemented on top of their Cocoa equivalents (respectively, NSString, NSArray, and NSDictionary). As an example, all strings in MacRuby are Cocoa strings, so they can be passed directly to underlying C or Objective-C APIs. It is also possible to call any method of the String interface on any Cocoa string, subclass Objective-C methods, etc.

Interesting. Anyone used macruby, and would like to share experiences.

1. How is the learning curve for a ruby programmer ?

2. Are using the String and other core classes just the same as ruby, or more difficult / cumbersome.

3. Can you reuse code from pure ruby apps, or does this re-implementation cause issues/problems.


1. How is the learning curve for a ruby programmer ?

None. MacRuby is an implementation of Ruby 1.9. A very fast Ruby implementation, but, not a completely new language thats only similar. HotCocoa is a gem. A very useful gem that should be the first thing you install, but, a gem.

2. Are using the String and other core classes just the same as ruby, or more difficult / cumbersome.

Just as easily.

3. Can you reuse code from pure ruby apps, or does this re-implementation cause issues/problems.

Sure. Go for it. It is Ruby, after all. Just with an optional gem to access another framework, in this case, Cocoa.


Could someone tell me what I would do using macruby. I am a ruby programmer on a Mac. What kind of apps could i write ?

Are these essentially GUI apps which otherwise i would write using Objective C or Cocoa (i assume its a standalone language) or QT, GTK etc.

So does this allow me to write apps that have the Mac L&F ?


> So does this allow me to write apps that have the Mac L&F ?

Yes. MacRuby works well with Interface Builder (the GUI designer for the Mac) and lets you write pretty much anything you could with Obj-C, just quicker :)

There's also the ability to package your MacRuby app as a .app that can be distributed without requiring MacRuby to be installed (MacRuby not required to run the packaged app), but the size of the .app is much larger than an equivalent Obj-C version


You can write native Cocoa apps with MacRuby that have Mac Look and Feel, with better than acceptable performance.

There are clean, high-level Ruby wrappings of UIKit classes, see HotCocoa: http://macruby.com/hotcocoa.html, although it's not clear to me how extensive this part of MacRuby is.


Just to nitpick, its AppKit, not UIKit. UIKit is on the iPhone, where, sadly, MacRuby isn't available.


I'm excited by MacRuby's architecture and performance, but can anyone comment on how extensive and usable the HotCocoa bindings are?


Ehm, sorry. I didn't notice the "upcoming". So it's not yet released but soon to be. (Is there any way to modify the title?)


Nice to see it progressing, but sad that we will probably never see it compiling iPhone apps.


Why do you think we'll never see it compiling iPhone apps? Neither the technical reasons - i.e. garbage collection in the iPhone Objective-C runtime, not the political reasons - the infamous 3.1.1, I presume, it doesn't do so already seem to me insurmountable. Especially since it is an Apple run project and one of its main goals is to be a first class Obj-C equivalent.


It's important to remember that when NeXTStep and Objective-C were first invented, they were invented explicitly from the inspiration of Smalltalk. Apple today is a descendant of NeXT. I'd speculate that not only that they've taken notice of Ruby, but have decided that since Ruby is the spiritual descendant of Smalltalk, it's worth trying to make Ruby the first-class applications programming language for OS X platforms.


Important to note is, that MacRuby is supported by Apple, and Apple employees are working on it.


Why not?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: