In hindsight, Swift was an obvious move

“It is easy to be wise after the event.” 
― Arthur Conan Doyle, The Complete Sherlock Holmes

The announcement of Swift at Apple’s WWDC 2014 conference with met with enthusiasm but also surprise, as despite the no doubt lengthy gestation period the language had remained a secret until the announcement.

While it might seems strange (and even exasperating) that Apple would go to the effort of creating yet another language rather than adapting an existing one, the logic behind the move is fairly apparent with a bit of reflection.

The first and most obvious reason for the move is that Objective C is now an old language which lacks the better productivity provided by more modern languages. But there are plenty of modern languages already available, so the need for a completely new language requires a bit more explanation.

One thing that eliminates a number of existing options is that any replacement for Objective C would need to also utilize the LLVM infrastructure which Apple have invested heavily in to eliminate dependency on GCC. This requirement is vital as the new language would have to inter-operate and coexist with Objective C to enable a smooth transition.

While work has been done on a number of existing language to allow them to run on an LLVM “back end” (including Scala and Go as well as many others), these efforts are not complete or mature. Apple could have decided to pick one of those language ports and invest in completing the work needed to make them more robust. However, Apple would not ultimately control this language and might run into conflict later down the track.

Ultimately, Apple must have judged that the amount of effort to build a new “front end” for LLVM was sufficiently low and justified by the control they would gain from having their own language. This desire for independence could be driven by the recent legal problems that Google had as a result of adapting Java for Android (Dalvik).

Given Apple’s desire to retain tight control over iOS and MacOS, their decision to replace Objective C with a wholly new language isn’t surprising. Whether this language will be successful remains to be seen – but if the (not entirely unbiased) enthusiasm of iOS engineers I know is any indication it will be embraced by the Apple engineering community. It could even encourage developers from other platforms to switch to Swift which can only help Apple grow in reach and significance.

Restored from Internet Archive · Capture: Sat, 19 Sep 2015 19:42:43 GMT