Apple Opens Source Swift System and Releases Swift 5.3





Apple has opened the source code of Swift System library. It provides an idiomatic set of programming interfaces to system calls and low-level data types. Swift System originally only supported system calls for Apple platforms, but has now been ported to Linux as well. The Swift System is written in Swift, and the company distributes it under the Apache 2.0 license.



Swift System is convenient because it provides a single point of access to all system interfaces. This feature can be used on all supported platforms, without specific C binding in Swift programs. On the positive side, Swift System does not unify system calls, but provides a separate subset of APIs for each supported platform, taking into account its behavior and accurately reflecting the low-level interfaces of the OS.



The company previously stated that a key goal of the Swift System is to make it easier to develop cross-platform libraries and applications, including SwiftNIO and SwiftPM. The Swift System does not eliminate the need for "#if os ()" -based branching when referring to low-level primitives, but it simplifies this work and makes it safer.



More news - Swift 5.3 is out . Official builds are ready for such operating systems as Linux (Ubuntu 16.04 / 18.04 / 20.04, CentOS 7/8), macOS (Xcode 12) and Windows 10. The source code is distributed under the Apache 2.0 license.



The new release adds initial support for the Windows platform, plus the delivery of tools for building and running Swift applications on Windows 10. Developers continue to improve the language's functionality. Among other novelties, it is worth noting the appearance of an initializer for the String type, the expansion of the use of the "where" expression, the change in didSet semantics, support for specifying several templates in Catch expressions, the addition of the Float16 type, and atomic memory operations.



An important point is reducing the size of the resulting applications. So, if in Swift 4 the size of an already finished program exceeded the analogue in Objective-C by 2.3 times, now this gap has been reduced to 1.5 times. The new release also accelerates incremental build and code build with a large number of properties and functions that are imported from other libraries. The diagnostic properties in the compiler and the quality of the displayed error messages have been extended. The package manager also implements the ability to include additional resources in the packages that are required at runtime. For example, images. The package manager now supports localization components with the ability to define conditional dependencies.



Swift is a modern language with many modern programming techniques, including closures, generic programming, lambda expressions, tuples and dictionary types, fast collection operations, and functional programming elements.



The Swift implementation involves the use of technologies from the free LLVM project. To ensure high performance, Swift applications are compiled to machine code that runs in Apple tests 30% faster than Objective-C code. For example, Swift uses object reference counting instead of a garbage collector.



The package includes the Swift Package Manager, which provides tools for distributing modules and packages with libraries and applications in Swift language, managing dependencies, automated downloading, building and linking components.






All Articles