Swift 6.4 Released with Improved Tooling and Interoperability
Swift 6.4 is now available, introducing key updates to build systems, cross-language interoperability, and daily development workflows.
Swift 6.4 introduces major updates to build systems and cross-language interoperability.
- Swift 6.4 makes the Swift Build system the default for the Swift Package Manager.
- The Subprocess library reaches version 1.0, offering stable cross-platform execution.
- New language features include module selectors for ambiguous APIs and @diagnose for custom compiler warnings.
- Enhanced C++ and Java interoperability broadens the language's utility across different runtimes.
Overview of Swift 6.4
The Swift development team has released Swift 6.4, the latest update to the open-source programming language. This version focuses on refining the developer experience, enhancing build infrastructure, and deepening interoperability with other ecosystems such as C++, Java, and WebAssembly. These changes are intended to streamline codebases and improve the reliability of build pipelines across Linux, macOS, and Windows.
Build and Tooling Enhancements
A significant change in this release is the transition to Swift Build as the default system for the Swift Package Manager (SwiftPM). This standardization ensures that projects remain consistent regardless of the underlying platform. Furthermore, the release introduces Software Bill of Materials (SBOM) generation, supporting both SPDX and CycloneDX formats. These additions provide developers with better tools for supply chain transparency.
Debugging has also received attention. Swift 6.4 concludes a series of updates aimed at improving how the compiler tracks modules in debug information. By utilizing precise dependency tracking, the system avoids ambiguous lookups, resulting in more robust debugging experiences. Additionally, debug builds on Windows and Linux, along with dSYM bundles on Darwin, are now more compact, as binary Swift modules are no longer embedded within them.
Language and Syntax Refinements
Several language features have been implemented to make code more readable and manageable:
- Module Selectors: To resolve naming conflicts, developers can now use the
::operator to specify which module an API belongs to, ensuring clarity when multiple imports provide the same type name. - Custom Warning Control: The new
@diagnoseattribute allows developers to define the behavior of compiler warnings directly in their code, including the ability to suppress specific warnings or elevate them to errors. - Optional Type Syntax: Working with
someandanytypes has become more natural; it is no longer necessary to wrap optional types in parentheses, such as changing(some Rocket)?tosome Rocket?. - Async Improvements: Developers can now utilize asynchronous functions within
deferblocks. These blocks will await completion, and the newwithTaskCancellationShieldAPI allows developers to protect specific cleanup tasks from being cancelled.
Interoperability and Performance
Swift 6.4 expands its reach across the technology stack through enhanced interoperability features. The Subprocess library has reached version 1.0, providing a stable, cross-platform approach to interacting with external programs. Additionally, Swift's Span type now bridges directly with C++20’s std::span, reducing the need for manual conversion code when working at the C++ boundary.
For Java developers, the Swift/Java interop project now supports calling async and throwing functions within protocol and callback wrappers. The release also improves performance for WebAssembly by optimizing the bridge through JavaScriptKit, which now reports faster execution speeds, and by providing a dedicated Wasm SDK via Swift.org.
Embedded Swift has also seen improvements, gaining support for existential types and expanded error handling to better support microcontroller-class targets. Performance optimizations continue, including the introduction of new array types designed to manage non-copyable elements without the overhead typically associated with copy-on-write mechanisms.
Enjoyed this?
Get more posts like this delivered to your inbox.
Related Articles
Vercel Formalizes Vercel Labs: 23 Open-Source AI Tools for Developers
3 min read
Laravel Releases Laravel MCP 1.0: Rapidly Build MCP Servers for Your Apps and Enable Search & Execute Tools for Your AI Agents
3 min read