Swift 6 Improves Linux Support
Written by Kay Ewbank   
Monday, 23 September 2024

Apple has released Swift 6, with improvements to support for writing concurrent code, specifically a new, optional language mode that analyzes your code at compile-time and diagnoses possible data races. The new release also adds a fully static SDK for Linux, new Linux distributions and improvements to Windows build performance. 

Swift is Apple's language that was originally developed as an alternative language to Objective C. Swift's designers aim is to provide a single language including the best ideas from languages such as C# and JavaScript, while being easy to use. It was made open source by Apple in 2015, and a Linux build was added at that point. Swift 6 is the first major new release of the language for five years.

swiftlogo
 

Alongside the concurrency improvements, Swift 6 also adds new low-level programming features, an embedded Swift language subset, and new cross-platform APIs including the new Swift Testing library.

The most striking improvement to Swift 6 is the new mode designed for developers writing code for multicore architectures. Compile-time data-race safety diagnoses concurrent access to memory across a developer's project at compile time, so allowing errors to be caught and fixed. This change should also remove the many false-positive data-race warnings that Apple says were present in the checks used in version 5.10. Developers can also create isolation regions that let the compiler show whether or not a section of code can run concurrently.

The next set of improvements are aimed at making Swift better cross platform. This starts with a fully static SDK for Linux that can be used to build fully statically linked executables for Linux that have no external dependencies, so can be copied directly onto a system or into a container and run it without installing any extra software. The SDK can also be used to cross-compile to Linux from other platforms. Swift 6 also adds official support and testing for Debian and Fedora, as well as on Ubuntu 24.04.

Windows build performance has also been improved through prebuilt toolchains for the arm64 architecture, which provides improved compiler performance for Windows on ARM hosts. The Swift package manager has also been enhanced to parallelize builds across multiple cores on Windows by default. Apple says that on a 10-core machine, this can improve build performance by up to a factor of 10!

Elsewhere, Apple has added support for additional code editors that make use of the Language Server Protocol; and Swift 6 also includes a preview of Embedded Swift, a language subset and compilation mode suitable for embedded software development, such as programming microcontrollers. The toolchain supports ARM and RISC-V bare-metal targets.

Swift 6 is available now.

swiftlogo

More Information

Swift Org

Swiftlang On GitHub

Related Articles

Swift 6 Adds Concurrent Code Mode

Swift 5.5 Adds Concurrency Support

Swift 5.2 Improves Performance

Swift Adds More Generics Support

Swift 4 Improves String Handling

Swift 3.0 Released!

Apple Launches Swift Playgrounds

Apple Open Sources Swift

Apple's New Language - Swift       

Swift 2 To Be Open Source       

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


OpenAI Releases Swarm
25/10/2024

OpenAI has released an experimental educational framework for exploring ergonomic, lightweight multi-agent orchestration. Swarm is managed by the OpenAI Solution team, but is not intended to be used i [ ... ]



AI Propels Python To Top Language on GitHub
30/10/2024

This year's Octoverse Report reveals how AI is expanding on GitHub and that Python has now overtaken JavaScript as the most popular language on GitHub. The use of Jupyter Notebooks has also surged.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info