What's New in Swift 6 โ€“ Part 2: Key Achievements
Xcode 16.0 Whatโ€™s New

Key Achievements in Swift 6

Swift Project Update

In the beginning, the Swift Core team was the only steering group & was responsible for the language evaluation process & other more tasks.

As the community has grown, the number of steering groups has expanded. This year the Platform steering group was introduced to focus on bringing Swift to more places.

Additionally, the Swift Core team is also actively working on creating a new ecosystem steering group to focus on the developer experience and the broader ecosystem.

The Swift Core team also working on introducing a new embedded work group

customization

Swift Everywhere

Swift Cross Platform

Swift continues to grow as a cross platform language, as it is being ported to more and more platforms. Now Swift is officially supported on Apple platforms, Linux, and Windows.

In addition there are a number of platforms being brought up by the Swift community, including WebAssembly.

This year Swift expanding the supported Linux platforms to include Fedora & Debian.

Swift Language Server

The new developed SourceLSP, a language server implementation for Swift that enables IDEs and editors to integrate Swift support.

You can find SourceLSP adopted in VSCode, Neovim, Emacs and more.

customization

Cross Compilations

Cross compilation is a common development use case, If you have been developing for apple platforms you already using cross compilation.

You can generate an executable on one environment and run it on a different environment. for example, you can build your app on macOS and run it on an iPad.

customization

The same capability brought to Linux. This means you can develop on a familiar macOS environment and deploy the program to a Linux server or a container.

customization

This has been done with the introduction of Static Linux SDK for Swift.

With Static Linking you gain:

  • Builds Linux binaries on macOS.
  • No need to install additional packages.
  • Build on Swift Package Manager support for SDK.

Foundation

Foundation is an essential component of many applications, one of the longest-lived frameworks.

customization

Since the language has evolved, and allowed us now to use a single unified implementation across all platforms. This is why now Foundation framework has rewritten from legacy C and Objective-C to modern, portable Swift.

The result is more consistent, has a higher quality and has a better performance.

New features and improvements come simultaneously to all supported platforms, just like Swift itself.

This Swift implementation first shipped in iOS and macOS last fall. For example, Predicate is an API that is now avaialble on all platforms in Swift 6 via swift-foundation.

This year it also gained support for regular expressions.

customization

Swift Testing

A new framework for testing. Its approachable, expressive, flexible, and scalable.

It takes advantages of modern Swift features such as macros and seamlessly integrates with concurrency.

customization

The package is developed in open source with cross platform in mind. Its designed to be seamlessly integrated into multiple IDEs such as XCode & VSCode.

The vision for Swift Testing library is to become the ecosystemโ€™s official, default testing solution.

We will talk about it more in details in another article, also you can read more about the full API from official docs here.

Building

There are some improvements to how Xcode builds the code.

When you build your Swift code, each module depends on other modules, often onces from the SDK. When the Swift compiler encounters a module like SwiftUI, it may need to build a binary version of that module. That happens implicitly so you might not even notice it. except for as a one-off slowdown.

However, its hiding a lot of work, because it has to build every module thatโ€™s used. Including ones written in Objective-C or C++ sequentially.

customization

When another Swift module is built, it will re-use the same binary modules, but it might have to wait until they are ready. Which means we arenโ€™t getting as much parallelism out of the build as we want.

Additionally, the debugger might have to build its own versions of all these module files.

This could lead to long pauses.

customization

When first printing variables in the debugger, Explicitly built modules turn those implicit steps into explicit build steps.

customization

This means that the module builds can be performed in parallel. and that they show up clearly in the build log.

The result leads to more predictable and reliable builds. The debugger can now share binary with the build, resulting in faster debugging.

customization

Explicit modules builds can be enabled in the Xcode build settings. To learn more please check Demystify explicitly built modules.

customization

Swift New Space

In the last 10 years, Swift has grown up a lot. Swift will be moving to a new organization on github.com/swiftlang. And will be managed by the Swift project.

This will include the Swift Compiler, Foundation, and many more Swift ecosystem packages.

Call to Action

Missed Part 1? Read Swift Over the Years โ†.

Next up: Part 3: [Language Updates in Swift 6 โ†’] Coming Soon.

-->