Version 5 of Apple’s Swift language used for iOS and MacOS application development 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.

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.

Leave a Reply