Apple has released Swift 4.0, the next version of its language. Version 3.0 will be released, and the next version 4.0 will be released next year.
The upgrade will include resilience to memory ownership model and strings, with a special focus on source stability for codes and ABI stability to the standard library. This documentation is available in GitHub.
According to the plan, Swift 4 will be released in two stages. Apple will first consider features that do not impact on fundamental changes to the ABI of existing features within the language.
Accommodations to support code bases for different languages are top-priority features that correspond to step 1. Swift can achieve source compatibility goals while making progress.
Step 1 also includes the resilience that allows APIs to evolve while maintaining stability in ABI. Apple is seeking to eliminate the fragile base class problem in object-oriented languages. Apple describes API modifications that can be made with minimal impact on the ABI.
Apple is known to be a strong advocate for generics improvements in its standard library. The documentation states that the library offers several workarounds to language weaknesses. “If the underlying language deficiencies persist, they become part of the permanent stable ABI.” “Conditional conformances and recursive protocol requirements as well as where clauses for associated type are all known to be included in this category. However, it is possible that other features could be included if they are used in the standard library.
System programmers are seeking an opt-in Cyclone/Rust-inspired model for memory ownership models in high-performance applications. The GitHub documentation states that this feature will fundamentally change the ABI. It will affect everything from low-level language concerns like ‘inout’ and ‘addressors, to its impact on standard library. Swift 4 stage 1 is unlikely to support a complete memory ownership model. We need a comprehensive design in order to understand how it will affect the ABI.
Apple claims that it must modify code generation, including interaction with the language’s runningtime, in order to stabilize the ABI. “While not directly user-facing, these decisions affect performance and (in rare cases) future evolution of Swift.” The upgrade also seeks strings to be more powerful and easy to use while maintaining Unicode accuracy.
The second stage of Swift 4.0’s development is anticipated to begin next spring. It involves the implementation of step 1 features. It includes various large and small features.
InfoWorld published this story in its initial publication.
