Apple published the release of the Swift 6.3 programming language. Official builds of prepared for Linux, Windows, and macOS. The source code is distributed under the Apache 2.0 license.
The Swift language combines the best elements of the C and Objective-C languages, providing compatibility with Objective-C’s object model. However, it differs in its approach to automatic memory allocation, variable and array overflow control, and protection against exploitation of uninitialized variables and memory access after it is freed. These features significantly enhance the reliability and security of the code. Swift also introduces modern programming techniques, such as closures, generic programming, lambda expressions, tuples, and fast operations on collections, along with elements of functional programming.
The Swift implementation is based on technologies from the free LLVM project, ensuring high performance by compiling Swift programs into machine code. Performance tests have shown that Swift code runs 30% faster than Objective-C code. Instead of a garbage collector, Swift uses object reference counting. The language also includes a package manager Swift Package Manager, which simplifies the distribution of modules and packages, managing dependencies, and automating loading, assembly, and linking of components.
Key changes in the new version include:
- The proposed first official release of the Swift SDK for the Android platform, enabling developers to use the Swift language for Android app development and integrate Swift components into existing Java and Kotlin Android applications.
- The addition of the “@c” attribute allows for exporting Swift functions and enums for use in C code, generating a corresponding header file with definitions for C.
- Implementation of module selectors for explicitly specifying which module’s API to use when multiple imported modules offer APIs with the same name.
- Introduction of new attributes to control compiler optimizations, such as @specialize for generic API specialization, @inline for function inlining, and @export(implementation) for exporting function implementations to the library’s stable ABI.
- A proposal for a preliminary implementation of the <