|Swift System Now Open Source|
|Written by Kay Ewbank|
|Thursday, 01 October 2020|
Apple's Swift System library for interfacing with system calls and low-level currency types has been made open source, and now supports Linux.
Swift System was introduced earlier in the year. Apple's Swift language supports accessing C interfaces, but Swift System goes further. Apple describes it as a multi-platform library rather than a cross-platform one. It provides a separate set of APIs and behaviors on every supported platform, reflecting the underlying OS interfaces. A single import will pull in the native platform interfaces specific for the targeted OS.
Swift System is designed to work with Swift and make it easier to use operating system APIs that provide C interfaces to system calls. Apple's plan is that Swift System will act as the single home for low-level system interfaces for all supported Swift platforms.
They say that the traditional APIs:
"suffer from several shortcomings and fail to utilize the expressivity and type safety of Swift".
The immediate goal for the open source Swift System is to make it simpler to build cross-platform libraries and applications such as SwiftNIO and SwiftPM. System does not eliminate the need for operating system specific conditionals, but it simplify the task of filling out the platform-specific parts.
The developers describe Swift System as being in its infancy—it currently includes a small number of system calls, currency types, and convenience functionality. To increase the API coverage, Apple plans to adopt System in the Swift Package Manager. This will include enhancements to FilePath and support for the recently announced Swift on Windows.
or email your comment to: email@example.com
|Last Updated ( Thursday, 01 October 2020 )|