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. Swift was launched by Apple in 2014 as an easier alternative to Objective C. It incorporates some of the best ideas from languages such as C# and JavaScript, and aims to be easy to use. However, until now developers have been cautious about adopting it on the principle that even Apple itself doesn't think it's stable enough to be included by default on the company's own devices.
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.
More informationRelated ArticlesSwift Adds More Generics Support Swift 4 Improves String Handling Apple Launches Swift Playgrounds Top Languages 2015 - Stasis But For Go And Swift
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |