Swift 6.3 advances Swift cross-platform story with official Android support, improves significantly C interoperability through the new @c attribute, and continues extending embedded programming support. It also strengthens the ecosystem with a unified build system direction and gives developers more low-level performance control.
To extend interoperability with the C language, Swift 6.3 introduces two new attributes, @c and @implementation. A Swift function annotated with @c will automatically get a corresponding declaration in the generated C/C++ header so you can call it from C/C++ code. In case you want to provide a Swift implementation for an existing C declaration, you can combine @c with @implementation, in which case the compiler will ensure the C declaration already exists.
Swift 6.3 also introduces module selectors, which let you to disambiguate function call when the same symbol exists in distinct modules, making it easier to explicitly reference the intended implementation. For example:
import ModuleA
import ModuleB
let x = ModuleA::getValue() // Call 'getValue' from ModuleA
let y = ModuleB::getValue() // Call 'getValue' from ModuleB
The new weak let declaration removes a long-standing limitations with classes and closures using weak references in concurrent contexts. In previous versions, in fact, the weak modifier could be used only with object references, using weak var, which made those references mutable and thus not sendable. weak let allows to capture a non-reference, immutable symbol inside a closure in a concurrency-safe way.
Other extensions to the language provide finer-grained control over compiler optimizations, including specialized implementations of generic APIs using @specialize, guaranteed method inlining using @inline(always), and more.
As mentioned, Swift 6.3 stabilizes the Swift SDK for Android, previously available only as a preview in nightly builds, which is designed to help developers port their Swift packages to Android.
With this SDK, you can start developing native Android programs in Swift, update your Swift packages to support building for Android, and use Swift Java and Swift Java JNI Core to integrate Swift code into existing Android applications written in Kotlin/Java.
As a final note, Embedded Swift has made significant progress by moving toward a unified linking model for embedded and non-embedded Swift, improving debugging facilities, providing more control over linking with the @section and @used attributes, adding support for memory-mapped I/O with Swift SMMIO, and more.