Swift 6.4
Swift 6.4 is now available in beta form with Xcode 27. The Swift Evolution proposals are listed here.
Discover the latest language advancements, including updates for everyday ergonomics, improved concurrency, and safer high-performance code. Explore workflow and language interoperability improvements and updates in embedded Swift.
Build real-time apps and services with gRPC and Swift:
Build engaging live experiences with gRPC in your Swift app and backend. gRPC is an open-source RPC framework designed for high-performance, bidirectional streaming APIs. Explore how the gRPC Swift package provides a modern, safe runtime built with Swift concurrency.
Explore numerical computing in Swift with MLX:
Bring NumPy-style computing natively to Swift with MLX Swift. Discover how to eliminate cross-language friction in your machine learning workflows by handling image processing, tensor operations, and neural network training in a single, type-safe environment. Explore the APIs that let you leverage GPU acceleration while enjoying the compiler, tooling, and debugging experience you already know.
Join us online for a deep dive into WWDC26 with Apple engineers and designers to ask questions, get advice, and follow the discussion about the week’s biggest Swift announcements.
There’s a voting system. And that means a number of questions weren’t selected. This time I copied those down and I thought it could be fun to take a shot at answering the ones that are more in my area.
Xcode 27 Beta 2 Release Notes:
The Swift dependency scanner has been optimized to avoid redundant setup work and header searches when looking up Clang modules during a single dependency-scan action, substantially improving scanning performance.
As a consequence of this change, every Clang module reachable from a single Swift dependency-scan action must have a unique module name. If two module maps visible to the same scan declare a Clang module with the same name, the scan may report an error.
[…]
System now provides Swift APIs for the C
stat,lstat,fstat, andfstatatsystem calls. This includes a newStattype with initializers fromFilePath,FileDescriptor, or a C string;FilePath.stat()andFileDescriptor.stat()instance methods; and supporting types (FileType,FileMode,FileFlags,UserID,GroupID,DeviceID, andInode).
The final piece of the Prospective Vision for Accessors, this allows for more efficient accessors on
structs, in a nutshell.[…]
Now there’s a safer version of the existing
withUnsafeTemporaryAllocation(first introduced in Swift 5.6). It works just like you’d expect. It comes in both “raw bytes” and typed elements versions, just like its unsafe predecessor.[…]
The new
isTriviallyIdentical(to:)method offers a guaranteed-fast way to check two objects for equality. It is essentially an optimised version of the existing equality condition provided byEquatableand the==operator. It’s useful because it guarantees O(1) time complexity, whereas==makes no formal guarantees at all (and for many types is O(N) or worse). But unlike the existing identity comparison operator===– also O(1) – it promises to do more than just tell if two objects are the exact same pointer, and it works on value types (not just reference types).[…]
These new types generalise the existing patterns of borrowed and mutable references, that have previously existed in Swift in much more restricted forms (e.g.
inoutparameters are essentiallyMutableRefparameters, andSpan&MutableSpanare array equivalents).There’s now a built-in function for demangling Swift symbol names, in the
Runtimemodule (that’s bundled with the Swift toolchain, alongside the stdlib etc).
As Apple has aligned OS version numbers across platforms, Swift 6.4 takes the next step by letting you collapse repetitive availability attributes into a single
anyAppleOStoken.[…]
There are situations where you need to call a deprecated API while you plan a migration, or audit a critical function for unsafe usage, without letting those concerns bleed into the rest of the project. The new
@diagnoseattribute handles both cases.[…]
Some work should complete even after a task is cancelled, like flushing a file to avoid corruption.
withTaskCancellationShieldwraps a region whereTask.isCancelledalways returns false.
Swift 6.4 implements SE-0493: Support
asynccalls indeferbodies. This is one of those changes that feels obvious once you need it.[…]
Swift 6.4 improves error handling for unstructured tasks through SE-0520: Discardable result use in Task initializers. The change helps you catch a subtle bug: creating a throwing task and then ignoring its returned task handle.
[…]
Swift 6.4 also implements SE-0530: Async Result Support.
[…]
Swift 6.4 implements SE-0518:
~Sendablefor explicitly marking non-Sendabletypes. It allows you to communicate that a type has been audited and should not conform toSendable.
I thought it would be a good time to detail some of the type checker performance improvements we worked on since I shared the type checker performance roadmap last year. I’m also going to outline a couple of things we plan on looking at next.
Previously:
- Swift 6.3
- WWDC 2026 Links
- Xcode 27 Announced
- Swift Pitch: Borrowing Sequence
- Roadmap for Improving the Swift Type Checker
- Swift 6.2: Subprocess
- Swift Prospective Vision: Accessors
- Swift Proposal: Precise Control Flags Over Compiler Warnings