Movatterモバイル変換


[0]ホーム

URL:


Swift 5 Released!

Swift 5 is now officially released!

Swift 5 is a major milestone in the evolution of the language. Thanks to ABI stability, the Swift runtime is now included in current and future versions of Apple’s platform operating systems: macOS, iOS, tvOS and watchOS. Swift 5 also introduces new capabilities that are building blocks for future versions, including a reimplementation of String, enforcement of exclusive access to memory during runtime, new data types, and support for dynamically callable types.

You can try out some of the new features in thisplayground put together by Paul Hudson.

Language Updates

Stable ABI and Binary Compatibility

The ABI is now declared stable for Swift 5 on Apple platforms. As a result, the Swift libraries are now incorporated into every macOS, iOS, tvOS, and watchOS release going forward. Your apps will be easier to build and smaller because they won’t have to include those libraries.

See these blog posts for more details:

Standard Library Updates

The standard library in Swift 5 includes the following new features:

  • String reimplemented with UTF-8 encoding which can often result in faster code (See theUTF-8 String blog post for more background on this change)
  • Improved support for raw text in string literals (See theString Literals blog post for more background on this refinement)
  • Result and SIMD vector types added to the Standard Library
  • Enhancements to String interpolation, adding more flexibility to construct text from data
  • Performance improvements to Dictionary and Set

Swift 5 implements the following Standard Library proposals from the Swift Evolution process:

Additional Language and Compiler Updates

Swift 5 defaults to enforcing exclusive access to memory for both debug and release builds (See theSwift 5 Exclusivity Enforcement blog post for more information about this update). And Swift 5 supports dynamically callable types that help improve interoperability with dynamic languages such as Python, JavaScript and Ruby.

Swift 5 also implements the following language proposals from the Swift Evolution process:

Package Manager Updates

Swift Package Manager includes a number of new features in Swift 5, including dependency mirroring, target-specific build settings, customized deployment targets, and the ability to generate code coverage data. Additionally, theswift run command now includes the ability to import libraries in a REPL without needing to build an executable.

Swift 5 implements the following Package Manager proposals from the Swift Evolution process:

Migrating to Swift 5

Swift 5 is source compatible with Swift 4, Swift 4.1 and Swift 4.2.

To help with moving to Swift 5 from earlier releases of Swift, Apple’s Xcode 10.2 contains a code migrator that can automatically handle many of the needed source changes. There is also amigration guide available to guide you through many of the changes — especially through the ones that are less mechanical and require more direct scrutiny.

Documentation

An updated version ofThe Swift Programming Language for Swift 5 is now available on Swift.org. It is also available for free on theApple Books store.

Platforms

Linux

Official binaries for Ubuntu 18.04, Ubuntu 16.04 and Ubuntu 14.04 areavailable for download.

Apple (Xcode)

For development on Apple’s platforms, Swift 5 ships as part ofXcode 10.2.

A toolchain is alsoavailable for download from Swift.org.

Sources

Development on Swift 5 was tracked in the swift-5.0-branch on the following repositories on GitHub:

The tagswift-5.0-RELEASE designates the specific revisions in those repositories that make up the final version of Swift 5.

Theswift-5.0-branch will remain open, but under the same release management process, to accumulate changes for a potential future bug-fix “dot” release.


Authors

Ted Kremenek is a member of the Swift Core Team and manages the Languages and Runtimes group at Apple.

Continue Reading


[8]ページ先頭

©2009-2025 Movatter.jp