Version 5 of Apple’s Swift runtime officially released yesterday, introducing improvements to application size and performance and a number of language and library changes based on suggestions from the Swift Evolution process.
Swift 5 has been pushed to all Apple operating systems, macOS, iOS, tvOS and watchOS. Ted Kremenek, manager of the Languages and Runtimes team at Apple, says that with the library features being implemented into the mainline Swift runtime, they no longer have to be bundled into compiled applications, resulting in smaller, faster apps. This follows the Swift 5 ABI (Application Binary Interface) being declared stable last month.
The Swift 5 Standard Library now features a reimplementation of the String type using UTF-8 encoding, which will also improve application speed, Kremenek wrote in a blog post.
In addition, the Standard Library’s support for raw text in string literals has been improved, the Result and SIMD vector types have been implemented, and String interpolation and Dictionary and Set types have received enhancements. Alongside those, Swift 5 implements 16 other proposals from Swift Evolution.
Language changes include six more proposals implemented from Swift Evolution, and the enforcement by-default of exclusive access to memory during runtime.
More information about all of the library and language changes in Swift 5, as well as information on migrating from previous versions, can be found in Kremenek’s blog post.