This week's sponsor


Business Productivity App for Mac & iOS

Swift Links

The third big announcement that followed OS X Yosemite and iOS 8 yesterday was Swift, Apple's new programming language meant to replace Objective-C.

From Apple's website:


Swift has been in the works since 2010, as confirmed by Chris Lattner, Director of the Developer Tools (via John Siracusa):



One of the key features of Swift is interactive Playgrounds, which will allow you to type code and see the results appear immediately:

Playgrounds make writing Swift code incredibly simple and fun. Type a line of code and the result appears immediately. If your code runs over time, for instance through a loop, you can watch its progress in the timeline assistant. The timeline displays variables in a graph, draws each step when composing a view, and can play an animated SpriteKit scene. When you’ve perfected your code in the playground, simply move that code into your project.

As an introduction to Swift, Apple has created the Swift Programming Language guide, available as a free eBook on iTunes and on the web:


Over at The Verge, Ben Popper talked to iOS and OS X developers and collected their reactions to Swift:

The other big idea behind Swift is that programmers can write their code and see the results in real time. In the old paradigm, developers write line after line of code in a text box, then compile those results — sometimes a lengthy, painful, productivity-denting task — and wait to see the end result. The product and the process were distinct from one another. With Swift, they can tweak a parameter or algorithm and watch the changes happen right away in the same coding environment. Theoretically, this means developers can toy with concepts faster and make what they’re trying to make in less time.

Last, Tim Stevens has a good general overview at CNET, explaining the differences between various programming and scripting languages and Apple's approach with Swift:

Scripting languages, like Python, tend to be easy to write and easy to test, but they aren't particularly powerful and generally don't perform well. Not ideal when you're writing, say, a game that needs access to the full power of your device. Traditional programming languages, like Objective-C, give better access to the power of the device and enable the creation of more comprehensive apps, but are difficult to learn and tedious to compile and test.

Swift promises to have all the good with none of the bad. Apple promises that, at least in a few key benchmarks, it is considerably faster to execute than Python and faster even than Objective-C. But, despite that, the language supports what's called “playgrounds” within the Xcode developer environment, visualizing Swift code in real-time, like a scripting language.