Paul Krill
Editor at Large

Swift 5.1 offers module stability for binary frameworks

news
Sep 26, 20192 mins

The update to Swift 5.1 also introduces features for library evolution and compiler and library improvements

update upgrade blackboard
Credit: geralt

Swift 5.1, an upgrade to Apple’s general-purpose language built as a replacement for C-based languages, introduces module stability. Module stability allows Swift developers to create binary frameworks that will work with future releases of the language.  

Swift 5.1 introduces a new text-based module interface file that describes the API of a binary framework, allowing for compilation of Swift code using different compiler versions. Swift 5.1 also includes property wrappers that introduce a general purpose syntax for defining custom access patterns for property values including thread-specific storage, atomic operations, delayed initializers, and copy-on-write behavior.

Other new capabilities and improvements in Swift 5.1 include:

  • Support for a library evolution build mode, which allows developers to make certain changes to types without breaking the library’s ABI. Developers can opt out of this feature on a per-type basis.
  • Updates to the standard library including support for handling and updating diffs on collections and appropriate types, greater flexibility for accessing an array, and more APIs for working with Strings. API improvements were made for working with SIMD types including support for extending vectors. The standard library also adds an identifiable protocol for entities requiring unique identifiers.
  • The return keyword is no longer needed for single expression functions or getters.
  • Opaque result types enable the use of a generic type to support different types conforming to the same protocol or to hide implementation details in APIs.
  • Self can be used for value types and classes.
  • The compiler now synthesizes default values for properties with default initializers.

Where to download Swift 5.1

You can download Swift 5.1 from swift.org.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author