Hacker News new | ask | show | jobs
by skidooer 5485 days ago
Ruby essentially is Objective-C without the C.

If Apple was looking for a language that moved away from the low level C, what benefit would an "Objective" language bring over MacRuby, which is already using the native Objective-C system frameworks?

1 comments

A non-runtime type system.

First class familiar Objective-C-style messaging and block syntax.

Stable, mature, well defined language invariants on par with Apple's requirements for its own APIs and languages.

"Objective-C without the C" would look more like Smalltalk or Strongtalk with a near identical syntax, not Ruby.

I may be misunderstanding you, but:

When you remove the C bits, Objective-C and Ruby use the same type system, conceptually speaking. They are both descendant from Smalltalk; the main feature differences really come down to the syntax alone.

I really like the idea of a higher level Objective-C-based language, I just don't necessarily see the business appeal of creating and maintaining a brand new language that only brings a more familiar, to Objective-C developers at least, syntax. Especially given the amount of effort Apple has been putting into MacRuby.

When you remove the C bits, Objective-C and Ruby use the same type system, conceptually speaking. They are both descendant from Smalltalk; the main feature differences really come down to the syntax alone.

Objective-C is typed -- not just the C part, but the 'Objective' part too. You can cast around type system, but it's there.

The new compiler even uses inference of those types in order to implement ARC.

Especially given the amount of effort Apple has been putting into MacRuby.

Not Apple, just a few people that also work for Apple.

The type system exists, but when working with the Objective half of the language, it is mostly meaningless, at least from a developer's point of view. With the C parts removed, you could replace every type definition with id and your program would run just fine.

The article says that MacRuby is bundled with Lion as a private framework. Surely they wouldn't bundle it if they weren't using it? And being a private framework, it is not there for the benefit of third-party developers.

Objective-C is typed, and that's considered (by Apple, and most developers) as a feature, not just a legacy inheritance from C.
Objective-C types are optional and the language is dynamic, and that's considered (by Apple and most Objective-C developers) a feature.

    id something = nil;
    [something countForObject: nil];
Completely valid, won't crash your program, and only enough type information to satisfy the compiler (but largely meaningless for anything but the most basic static analysis). The only requirement for the above to compile is that countForObject: is a selector defined somewhere in the include path for the file. Even that is a relatively soft requirement since you can pass arbitrary selectors to any object.

And none of this has anything to do with ARC, as far as I can tell.

There was a first class language on Mac OS X which was fully statically typed. It was deprecated with Leopard and never introduced on iOS. The dual nature of Objective-C is one of its attractive properties.