Version 5 of Apple’s Swift language used for iOS and MacOS applicationdevelopment will arrive in late 2018 with ABI (application binary interface) stability in the standard Swift library a primary focus—delaying a feature originally intended for the upcoming Swift 4 release.
Locking down the ABI iin Swift 5 will mean any future compiler versions can produce binaries that conform to the stable ABI. “Once an ABI is stable, it tends to persist for the rest of the platform’s lifetime due to ever-increasing mutual dependencies,” according to Apple documentation.
[ Download InfoWorld’s essential guide to microservices and learn how to create modern web and mobile applications that scale. | Cut to the key news and issues in cutting-edge enterprise technology with the InfoWorld Daily newsletter. ]
This stability only affects invariants of externally visible public interfaces and symbols. Internal conventions, symbols, and layouts can keep changing without breaking the ABI. Compilers, for example, are free to change calling conventions to internal function calls as long as public interfaces are preserved.
Decisions about the ABI are serious business, with long-term ramifications and possible limitations on how the language can evolve. But ABI stability means that operating systems can embed a Swift standard library and runtime compatible with applications build with both newer and older versions of Swift. The applications thus do not need to distribute their own copy of these libraries.
ABI stability is half of what is needed to support binary frameworks. The other half, module stability, will be a “stretch goal” for Swift 5 and may not make it into the release, Apple’s roadmap notes.