From: John Joyce Date: 2008-06-09T01:20:27+09:00 Subject: Re: [ANN] MacRuby 0.2 On Jun 8, 2008, at 9:10 AM, Gregory Seidman wrote: > On Sat, Jun 07, 2008 at 09:47:12AM +0900, Laurent Sansonetti wrote: >> Hi, >> >> After 3 months of development, here comes the second release of >> MacRuby, 0.2! Check it out while it's still hot! >> >> MacRuby is a version of Ruby 1.9, ported to run directly on top of >> Mac >> OS X core technologies such as the Objective-C common runtime and >> garbage collector, and the CoreFoundation framework. While still a >> work in progress, it is the goal of MacRuby to enable the creation of >> full-fledged Mac OS X applications which do not sacrifice performance >> in order to enjoy the benefits of using Ruby. > [...] > > I realize this is a long shot, but I was wondering if there was any > chance > that MacRuby could become available on the iPhone. I see two possible > technical difficulties and one possible political difficulty: > > - Since ObjC on iPhone does not support garbage collection, there > may be > additional work to make the Ruby GC manage things with release/ > retain. > > - Since the iPhone is battery-based, performance matters in terms of > wattage, and a Ruby interpreter may be too inefficient for mobile > use. > > - Politically, since Apple expressly does not want interpreted code > downloaded from elsewhere and run on the device (e.g. Flash, Java, or > really anything other than JavaScript running in a web component), > providing a language interpreter may appear to run against that > interest. > > I'm sure you, as an Apple employee, can't comment on the political > issue or > the likelihood of MacRuby becoming available in the iPhone SDK (i.e. > future > products). If you could comment on the two technical issues, though, > I'd > appreciate it. Also, if you weren't thinking in terms of getting > MacRuby on > the iPhone, please do; I'm working on an iPhone app now and Ruby > would have > been a nice way to go about it. > >> Enjoy, >> Laurent > --Greg > > Greg, GC is not that big of a deal. The reference counting mechanism of Objective-C is super easy. If you follow the rules, you'll be fine. In most cases, if you use an init method to instantiate, go down to your dealloc method and use a release. If your app crashes and the debugger gives you nothing but register numbers, you need a retain on an object somewhere, to keep it around long enough to do something with it. It's not tough at all. google for Uli Kusterer's site and you'll find his invaluable advice on retain/release. It's pretty darn easy.