|Swift Runtime Now Stable|
|Written by Alex Denham|
|Tuesday, 02 April 2019|
Apple is to include the Swift runtime in current and future versions of all its operating systems - macOS, iOS, tvOS and watchOS. The move has been made because Swift 5 has a more stable ABI.
The main highlight of the new version is the ABI stability. An Application Binary Interface (ABI) is the compiled version of an API, and it provides a way for programs to call functions and use data structures from other compiled programs. According to Swift developer Jordan Rose writing on the Swift blog:
"Swift’s ABI is currently declared stable for Swift 5 on Apple platforms. As development of Swift on Linux, Windows, and other platforms matures, the Swift Core Team will evaluate stabilizing the ABI on those platforms."
The fact the Swift libraries will now be included means your apps will be easier to build and smaller because they won’t have to include those libraries.
Alongside the ABI improvements, Swift 5 has other improvements, including a reimplementation of String, enforcement of exclusive access to memory during runtime, new data types, and support for dynamically callable types.
This version of Swift has changed the preferred encoding of strings from UTF-16 to UTF-8. The developers say this fulfills one of String’s long-term goals to enable high-performance processing. It also lays the groundwork for providing more performant APIs in the future.
There's also improved support for raw text in string literals. This has been achieved by adding custom delimiters to string literals and escape sequences. String interpolation has also been improved, adding more flexibility to construct text from data.
Other improvements include the addition of Result and SIMD vector types to the Standard Library; and performance improvements to Dictionary and Set.
or email your comment to: firstname.lastname@example.org