Programming Languages
Swift 6.4 ships with production-ready Subprocess API, faster WebAssembly, and streamlined concurrency
The latest Swift release debuts a stable process-management library and significant performance gains for WebAssembly, alongside refinements to syntax, concurrency primitives, and language interoperability.
InfoQ
Swift 6.4 marks a substantial step forward for the language, delivering production-grade tooling and notable performance improvements. The release introduces a stable Subprocess library for cross-platform process management, WebAssembly code that runs up to 40 times faster, expanded support for value semantics, and deeper integration with C++20 and Java.
Language and Syntax Refinements#
The update makes common patterns more concise. Optional generic types can now be written as AType? rather than the longer (some AType)? or (any AType)?. A new @diagnose attribute lets developers fine-tune compiler warnings and error reporting. Module-qualified names using the AModuleName:: syntax help developers disambiguate when multiple imports share the same symbol.
Concurrency and Cleanup#
Asynchronous cleanup operations become more straightforward in Swift 6.4. The defer statement now accepts await directly, removing the need to wrap async calls inside a separate Task. A new withTaskCancellationShield primitive temporarily shields code from task cancellation, ensuring critical cleanup logic completes even when cancellation has been signalled.
Swift Concurrency expert Antoine van der Lee noted the practical value of these changes: "Swift 6.4 brings several practical improvements to Swift Concurrency. [...] Not every feature will change how you write code every day, but together they remove friction from strict concurrency adoption."
Performance Through Non-Copyable Types#
The release expands Swift's support for non-copyable and borrowing semantics to reduce unnecessary copying and memory allocations. New types include:
- UniqueBox: a non-reference-counted smart pointer that owns a heap value and enforces non-copyable guarantees
- UniqueArray: a dynamic buffer that sidesteps copy-on-write overhead
- Iterable: a protocol enabling borrowing-based iteration
- Ref and MutableRef: first-class containers for borrowing or mutating individual values
