Apple to Make Ruby First-Class Language?

The worst thing about developing for the Mac or iOS is Objective C. Obj-C was a heck of a good experiment 20 years ago, but it’s just not a good fit for today’s mainstream programming mindset. In the wake of Apple’s relenting on the use of 3rd party language tools for iOS comes the rumor that Apple has been working on, and is about to go public with, a Ruby implementation.

It makes a lot of sense. It makes even better sense if Apple is “going big” and aiming to capture mindshare by producing a dazzling “iLang.”:

  • At some point, Apple will have to move beyond Objective C. It’s just a question of the language.
  • Objective C on iOS requires manual memory management, the most bug-prone area of single-threaded apps. Ruby has built-in garbage collection.
  • Matz’ Ruby Interpreter is notoriously complex; if Apple could create a  VM or hybrid native runtime using their investment in LLVM it could easily be much faster than existing Ruby implementations.
  • Grand Central Dispatch is a good match for Ruby semantics. Combined with a fast implementation, this could allow Apple to boast of a “best of all possible worlds” approach to concurrency.
  • The timeframe is about right — Ruby’s success became apparent several years ago. The creation of a commercial-grade high-performance Ruby implementation would take about this long to get through the pipeline.
  • The Ruby ecosystem is large and friendly to OS X.
  • Ruby is both “sexy” and admired by programming-language geeks. Yet it’s not radical in the way of, say, a pure functional language. Were Apple to make Ruby a first-class language, they would be dealing with a known commodity in terms of learnability, resources, and limitations.

Finally, one can imagine Ruby being dressed up in a nice new suit and given a pair of really cool designer sunglasses and pitched by Steve Jobs as something extraordinary and “the world’s best” and “revolutionary,” etc.

As a matter of fact, it’s interesting to imagine what a Stevenote about programming languages might look like. Any thoughts?

12 thoughts on “Apple to Make Ruby First-Class Language?

  1. Rumor? MacRuby’s been around for 2-3 years:
    http://www.macruby.org/
    It’s being developed by at least one Apple employee, who has taken Ruby 1.9, and and moved it to Objective-C, exchanging the GC, adding a JIT and AOT (both based on LLVM), removed the GIL, etc.
    For some more info on those developments see my articles over @ InfoQ:
    http://www.infoq.com/MacRuby

    Larry sez: I didn’t know that MacRuby was an internal Apple project. Hmm…Given the lack of love given to MacRuby, it probably argues against my thesis!

  2. it would make Ruby even cooler than it is today, but I just don’t see this happening, doesn’t seem like the kind of thing Apple would be good at, Apple creates pretty things, not necessarily things that work good or have good architecture underneath, a language like Ruby wold be a major undertaking, I don’t think Apple has the engineers for this type of thing

    just my $0.02

  3. They already have a VM for running an excellent high level language on their iDevices – Javascript. They could just port the native API’s to it and let developers at it.

  4. There is a commercial-grade high-performance Ruby implementation. It’s called JRuby. It’s faster than MRI, doesn’t have a GIL, has access to the JVM, AND MOST IMPORTANTLY: is the most compatible and fully featured Ruby implementation that’s not MRI.

    Sure MacRuby is going to be great, but JRuby supports the stdlib, runs Rails, is now even running a lot of gems that have c-extensions even.

    People pass JRuby up, and it’s a friggin shame. They’ve done some great pioneering work, a lot of which has laid a foundation for things like MacRuby.

    Larry sez: JRuby is a good option when the JVM is available, but that’s not the case with iOS…

  5. @Eber That is bull! Apple has probably better engineers than Google has and they are very capable of creating a ruby like language.

  6. Like murphee said, this is hardly a rumour. You might want to put that as line one on the post before unsuspecting readers yell at you for ‘reporting’ old news.

    @eber – Bah, it’s been done already and I’m running it. And you forget that the Apple engineers have built shit like OSX and yes, Rosetta.
    @Ted – Have you tried building Cocoa apps in Jruby? Yeah, I thought not. And JRuby runs on Android fwiw if you want to hack mobile Ruby apps.

  7. Objective-C and Ruby are actually both similar in a lot of ways since they come from the same heritage as to how their object systems are designed, which is Smalltalk. The degree to which MacRuby fits with the Objective-C runtime makes too much sense for Apple not to at least officially support and promote it. It wouldn’t have to be about replacing Objective-C either, just giving developers another option. The Objective-C 2.0 runtime has GC, which MacRuby relies on, but that’s only available for Mac OS X and not iOS, so AFAICT, that’s the only thing preventing us from writing iOS MacRuby apps today.

    On the other hand, with 250,000 apps in the app store already, there’s not much incentive for Apple to improve their development tools, since they seem to be doing just fine as is. Having said that, I would love to see MacRuby for iOS. :)

  8. In addition to JRuby another option is to embrace Rubinious which does use LLVM under the covers. Rubinious continues to improve on feature set and performance.

    http://rubini.us/

  9. @will Apple engineers didn’t create Rosetta. They bought the technology from a British company called Transitive (actually, a University of Manchester spin-off).

Comments are closed.