3 ms·
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? MomBook:~ hackermom$ ruby -v ruby 1.8.7 (20
by hackermom 16y ago
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?
MomBook:~ hackermom$ ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
- wrs 16y agoIt 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.)
- Zev 16y agoAlso 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.
- aaronblohowiak 16y agoyes. 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.
- frofro 16y agoNo, it's an alternative implementation of Ruby 1.9 that allows you to interface directly with native OS X frameworks.
- demallien 16y agoIt'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)