Programming

How My Nerdy Hobby Became Mainstream for a Day

or

Python and Ruby vs Swift

Why do mainstream (or even tech-oriented) news outlets suddenly care about programming language design?

The Wired article got it wrong. They spelled out all of the advantages of Swift and then published a whiny claim that Apple should have just gone with Python or Ruby.

The design choices that Apple made with Swift reflect the fact that they are an operating system(s) developer. They want something for the next 20 or 30 years, not something that is already outdated. (Disclosure: I love Python and use it regularly.)

Swift is like a mix of Objective-C, C++, and C#, with all of the advantages of each (dynamism, speed, and high-level/declarativeness, respectively) and none of the disadvantages of each of them (respectively: runtime slowness, unsafety and language complexity and over-design, and heavy VM). Not to mention a healthy infusion of ideas from functional languages like F# and Haskell.

What Apple accomplished with the design of Swift makes it totally clear why they would want to lead instead of follow. Suggesting Python or Ruby is simply folly because the languages are not sufficient to move every single developer at Apple developing APIs for the operating system itself onto those languages. Remember the JavaScript-powered Palm OS? Running on a full tablet (HP Slate)? Maybe barely. This is a completely unreasonable suggestion and I cannot believe that Wired ran an article with this suggestion unchallenged. Who is their chief editor of programming language topics?

Of course we would like to see Apple use a language that made it easier to develop cross-platform. But of course the Wired article did not mention C# and Xamarin (disclosure: I am this species of developer). And they did not mention whether Apple's existing technology, Objective-C, is or is not (answer: is) available on other platforms, perhaps supporting framework ports by open-source providers? using Apple's amazing BSD-licensed LLVM compiler suite, presumably of which Swift will be part?

The article barely mentions that Objective-C and C++ and C binaries are still source-compatible with Swift and show that Apple is still committed to allowing cross-platform code.

But the article, if they actually were interested in diving deeper, should have mentioned that this existing cross-platform support is basically a bloody mess. The simple way to explain this is to mention that the Apple compiler suite has support for a toxic hellstew called Objective-C++. If this doesn't make your eyes bleed then nothing will. Sometimes in language design, as in all design, less is more.

And, for all its power, by any language complexity measure, Swift is as simple as Python or Ruby, for sure.

Archive