Hacker News new | ask | show | jobs
by jonhohle 818 days ago
I don’t think it was every one or the other. Ruby wa/ hot around 2005 and Apple experimented with language bindings for AppKit (and osascript?). I did a bunch of prototyping using MacRuby and then would rewrite in Objective-C.

Ruby’s object model is relatively similar to objc - no direct member access outside the object, everything is loosely coupled messages with dynamic runtime, you could get away with duck typing in some cases in objc using `id` types (at the expense of getting type checks from the compiler).

I don’t think it was ever intended at the next system language, though. It was just a convenient binding and optimized runtime (many of its core types were Core Foundation types - NSString, etc. IIRC).

1 comments

Almost any object scripting language can use Objective C Bridge for scripting.

https://marketsplash.com/tutorials/objective-c/objective-c-b...

The difference was MacRuby was built on top of the Objective-C runtime. https://en.m.wikipedia.org/wiki/MacRuby
There was a brief window when it was possible to do some really cool stuff with MacRuby, such as inspecting and even monkey patching core OS X classes. Probably one major reason why Apple killed the project in the first place. Being able to interact with the operating system on a low level through macirb was an absolutely mind blowing experience.

Sadly, those days are long gone, and I just don’t think Swift brings the same kind of flexibility or joy that MacRuby did.