Re:MacRuby 0.6 Official Release
by hackermom on Monday May 03, 2010 @08:41PM
(#1316598)
Does anyone know how this differs from the Ruby that is a native part of OS X 10.6? Is it just a newer version?
[ Parent
| on HN ]
It uses the Objective-C runtime, including "native" objects (strings are NSStrings, hashes are NSDictionaries, etc.). It generates native code (using LLVM) rather than interpreting. It has a more sensible syntax for making Objective-C method calls. (And more.)
Also might be worth noting: MacRuby is an implementation of Ruby 1.9, not 1.8.x. Any benchmarks done should be compared against YARV, not what comes with OS X.
Re:MacRuby 0.6 Official Release
by aaronblohowiak on Monday May 03, 2010 @08:52PM
(#1316626)
yes. and hotcocoa is a wrapper for cocoa that is more rubyish for making native cocoa apps in ruby.
Also: The “Compile” target in Xcode allows an application to be ahead-of-time compiled to machine code, allowing the developer to avoid including the Ruby source in a shipping application.
No, it's an alternative implementation of Ruby 1.9 that allows you to interface directly with native OS X frameworks.
It's actually a bit more profound than that. macruby objects are Cocoa objects, so all of the funny edge cases that we used to have problems with in RubyCocoa have just gone away. For example, in RubyCocoa, if you try to serialise a proxy object representing a Cocoa object using YAML, and then read that object back in, the proxy is no longer created, and if you try to pass the object to a Cocoa API, the program crashes, because Cocoa was expecting a Cocoa object... The same operation in macruby works just fine (well, apart from the fact that YAML is evil, but at any rate, I have a macruby app that uses it, and it works fine)