Apple Releases Swift 5 with ABI Compatibility, New Features

This week, Apple's Swift programing language team released version 5 for use in Xcode 10.2, reaching the milestone of ABI stability—compatibility with code compiled with future versions of Swift compilers—and introducing new coding features for developers. Swift as a language is maturing alongside Apple's efforts to make code development an attainable skill for students.

Laptop displaying web browser with Welcome to Swift dot org

A primary feature of the new release is Application Binary Interface stability across Apple platforms (macOS, iOS, watchOS and tvOS). This means that Swift has matured as a language to the point where there will no longer be huge changes in how its compiler works that breaks compatibility with Swift apps and libraries that have already been compiled into binary.

As a result, Swift 5's ABI stability means app code compiled with today's compiler won't need to be recompiled to work reliably with dynamically linked libraries compiled in future versions of Swift. And that means that apps will no longer need to bundle a known version of the standard libraries they use, and can instead use whatever updated version is provided by the OS. This is already the case with apps written in Objective C.

This, in turn, enables slimming the download size of Swift apps, both in the App Store and in internal deployment testing using TestFlight. Key Swift 5 features were earlier outlined by Apple's head of Swift development Ted Kremenek in John Sundell's Swift by Sundell podcast.

The new Swift 5 delivers a series of coding features outlined by Sundell in a tweet (above) and detailed in Apple's official release notes, including the ability to express String literals using enhanced delimiters to support raw text. This clarifies code by removing the need to escape quotes or backslashes.

Apple's decade of Swift

Chris Lattner started the development of Swift at Apple in July 2010, but Swift only made its first public appearance at Apple's 2014 Worldwide Developer Conference. By the end of 2015, Apple had released version 2.2 of new language as open-source software under Apache License 2.0, enabling its use on Linux and other platforms.

Lattner oversaw rapid, significant changes in the language across its first three major versions before officially handing the reins to Ted Kremenek in January 2017. At the time Lattner stated that Kremenek was "one of the quiet but incredible masterminds behind Swift (and Clang, and the Clang Static Analyzer) for many years."

Kremenek has worked at Apple since 2007, and was the principal architect and original engineer of the Clang Static Analyzer that ultimately ended up in Xcode. Between 2009 to 2013, Kremenek worked on the LLVM Front-end team. Since 2017 he has served as senior manager of languages and runtimes at Apple, responsible for implementing the programming language support in Apple's compilers for Swift as well as Objective-C, C, and C++.

iPad and laptop displaying swift coding application

Last year, Swift adoption rose to the point of reportedly tying Objective C as a top ten programming language in use among developers on GitHub and Stack Overflow, according to analysis firm RedMonk.