Objective-C 2, Xcode 4, LLVM, what’s next?


Objective-C and Cocoa are a nice environment to work in. The nicety of Cocoa comes from the fact that it is an object runtime system rather than a bunch of objects compiled into a running program. A Nib file (or xib file as they are called now) is nothing else than a saved snapshot of instantiated and configured GUI objects. So loading a nib is like loading a Smalltalk image: living objects are woken up and continue running at just the place they were when they were saved.

So Objective-C and Cocoa are very similar to a Smalltalk system. But still lightyears away from the real thing. Apple is doing their best to make it better and better and make it feel like a live object system. The just-released Xcode 4 IDE is a big step forward into this direction. (Side note: The eclipse community is also constantly moving into the object system direction by building something very similar to a Smalltalk image).

The next logical step after the achievements with using LLVM as an intermediate layer below Objective-C would be to get rid of the C heritage of Objective-C. Not only is the fact that you have to put Objective-C expressions into square brackets annoying, but also the fact that you need to convert from base types and structs into Objective-C objects and back a lot more often than a programmer would like.

Rumors of Apple working on a new fully dynamic programming language that runs on top of LLVM and reuses the Cocoa object model aren’t really new, but I think they make sense. And having used both Objective-C and Smalltalk, I sometimes think that Objective-C is quite good, if only their creators had gone one or two steps further and made it not only a poor man’s Smalltalk, but rather a real alternative to it. But back in the 90ies when CPU cycles were expensive, NeXT probably had not many alternatives to preprocess down to C and compile classic C code. Today, the C fundament is the weakest spot of the language, not only in my opinion.

So I hope there’s some truth behind the speculations about a new language. Apple has owned a Smalltalk implementation in the past (it’s now open-sourced and called Squeak), so the new language is probably not going to be Smalltalk, but I am sure it will be very much like it (because Cocoa and Objective-C are very similar to Smalltalk and have proven to be powerful): dynamically typed, a live object system (maybe even image based) and with a pure and easy syntax. Swimming on Apple’s wave of success, this could get very popular, and it will surely feel a lot like Smalltalk.

With LLVM and far over a decade of experience with NeXT Step, Cocoa and Xcode, Apple has all that’s needed to build a great programming language, IDE and object runtime system that’s far superior to what most people out there are using today.

4 thoughts on “Objective-C 2, Xcode 4, LLVM, what’s next?

  1. Well I ‘ve my troubles why they don’t just use Smalltalk. It’s there they know it and the step from
    [Me doSomething] to Me doSomething seems not to be far😉

    And AFAIK at least one Smalltalk is compiled to C and than assembled. So why not have the best of a language like C (interfacing to whatever there is) and Smalltalk?

    1. Friedrich,

      I agree in principle: why not just use Smalltalk?

      But Smalltalk has a smell within Apple (I remember hearuing that in a podcast interview with Dan Ingalls) and Apple likes to have control. Smalltalk is open and there are a number of implementations that run on many platforms, including the mac (subtract native look&feel from the equation here). So as much as I’d love to see Apple invest in Squeak, Pharo or something completely new, I don’t think it’s going to happen.

      I rather think they’ll come up with something that is 97% like Smalltalk but pretty much resembles Objective-C. Their argument might be that this makes the transition easier. But the truth will be that they want to control it. Still it would be a great improvement and I guess it would be a lot of fun programming in it.

  2. Won’t happen in the near future. Apple lives on i* devices and cpu cycles are too expensive on these. CPU time starts to get cheaper on new iPads but it will take a few years at least. I’m happy to be proven wrong here, but I’m willing to bet a case of Flensburger Pilsener against a bottle of mineral water : no xlang on i* in the next 4 years. xlang defined as something a smalltalker or lisper recognizes as a dynamic language. And that obviously excludes ruby.

    1. HB,

      not sure this argument will hold for a long time into the future. If it were true, JavaScript on an iPhone were a real PIA. But it’s not.
      The iPad 2 ships with a Dual Core A5 chip with 1 GHz. And if you look at LLVM and the performance of modern VMs (like JavaScript in Webkit or the Cog Smalltalk VM) together with Smalltalks small memory footprint compared to a Java system, you’ll see that Smalltalk is a good choice for mobile devices.

      I am sure it won’t be long until we see garbage collection on iOS, and with LLVM beneath your Apps the differences between MacOS X and iOS will become even smaller than they already are. One of the big pro’s for iOS as a developer is that is pretty much the same thing as writing a Mac application.

      So forget about the CPU argument. These thoughts belong into the late 90ies and will soon be forgotten.

      I agree on your Ruby comment: hopefully, they go for something with a clean design.

Comments are closed.