Paul Krill
Editor at Large

What’s new in Apple’s Swift 5 language

news
Mar 28, 20192 mins

The latest version of the MacOS and iOS programming language enables slimmer apps, better interoperability

Apple has released its Swift 5 programming language, with a stable application binary interface (ABI) and binary compatibility that Apple says will result in the development of smaller applications. Interoperability with other languages is improved as well.

With this upgrade, the ABI is now stable on Apple platforms, so Swift libraries are now incorporated into every future release of MacOS, iOS,  WatchOS, and TVOS. Because developers will no longer have to include these libraries, applications will now be smaller and easier to build.

Other new features in Swift 5 include:

  • Dynamically callable types are supported to improve interoperability with languages such as JavaScript, Python, and Ruby.
  • Swift 5 defaults to enforcing exclusive access to memory for release and debug builds. This is intended to enhance Swift’s safety.
  • Swift 5 has a reimplementation of String, new data types, and enforcement of exclusive access to memory during runtime.
  • In the standard library, String has been reimplemented with UTF-8 encoding instead of UTF-16, which can result in faster code. Objective-C interoperability is preserved.
  • Swift 5 enhances string literals delimiters to support raw text. Single-line and multiline string literals are enabled and can contain any content.
  • Unicode properties to support common and advanced text processing are added to the Unicode.Scalar type.
  • For SIMD (single instruction, multiple data) vectors, the library exposes a subset of operations on the SIMD types supported by most processors in the library. 
  • Performance improvements have been made to Dictionary and Set.
  • The addition of a Result type, to improve error-handling.
  • The Swift Package Manager has target-specific build settings, dependency mirroring, customized deployment targets, and an ability to generate code coverage data.
  • The swift run command can import libraries in a read-event-print loop (REPL) without having to build an executable.

Where to download Swift 5

You can download Swift binaries for Linux from Swift.org. It also is available as part of the Apple Xcode 10.2 IDE, which is available from from the Apple Mac App Store.

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