Apple releases Swift 5.3 programming language and open source code for Swift System library

Apple Company announced about opening source libraries Swift System, which provides an idiomatic set of programming interfaces to system calls and low-level data types. Initially, Swift System only supported system calls for Apple platforms, but it has now been ported to Linux. The Swift System code is written in the Swift language and spreads licensed under Apache 2.0.

Swift System provides a single point of access to system interfaces that can be used on all supported platforms without the use of specific C bindings in Swift programs. At the same time, Swift System does not unify the system calls themselves, but provides a separate subset of the API for each supported platform, taking into account the behavior of this platform and accurately reflecting the low-level interfaces of the operating system. The key goal of creating the Swift System is to simplify the development of cross-platform libraries and applications, such as SwiftNIO ΠΈ SwiftPM. The Swift System does not eliminate the need for "#if os()" branching when accessing low-level primitives, but it does make it safer and
comfortable.

You can also note the publication of programming language release Swift 5.3. Official builds prepared by for Linux (Ubuntu 16.04/18.04/20.04, Π‘entOS 7/8), macOS (Xcode 12) and Windows 10. Sources extend licensed under Apache 2.0.

The new release adds initial support for the Windows platform and began supply of tools for building and running Swift applications on Windows 10. We continued to improve the functionality of the language. Of the new features, the addition of an initializer for the String type, the expansion of the use of the "where" expression, the change in didSet semantics, support for specifying multiple templates in Catch expressions, the addition of the type
float16, atomic memory operations.

The size of the resulting applications has been reduced - if in Swift 4 the size of the assembled program exceeded the Objective-C version by 2.3 times, now the gap has been reduced to 1.5 times. The new release also noticeably speeds up incremental builds and building code with a large number of properties and functions imported from other libraries. Enhanced diagnostic tools in the compiler and the quality of displayed error messages. The package manager implements the ability to include additional resources needed at runtime, such as images, into packages. The package manager also adds support for components for localization and the ability to define conditional dependencies.

Recall that the Swift language inherits the best elements of the C and Objective-C languages, and provides an object model that is compatible with Objective-C (Swift code can be mixed with C and Objective-C code), but differs in the use of automatic memory allocation and control overflows of variables and arrays, which significantly increases the reliability and safety of the code. Swift also offers many modern programming techniques such as closures, generics, lambda expressions, tuples and dictionary types, fast collection operations, functional programming elements. The Linux version is not tied to the Objective-C Runtime, which allows the language to be used in environments that lack Objective-C support.

The Swift implementation is built using technologies from the free LLVM project. To ensure high performance, Swift programs are compiled to native code that runs in Apple tests 30% faster than Objective-C code. Instead of a garbage collector, Swift uses object reference counts. Package manager included Swift Package Manager, which provides tools for distributing modules and packages with libraries and applications in the Swift language, managing dependencies, automated loading, building and linking components.

Source: opennet.ru

Add a comment