talira

Swift System

Idiomatic Swift interfaces to system calls and low-level types

open sourceApache-2.0free

Swift System is Apple's open source package of idiomatic Swift interfaces to system calls and low-level currency types such as FilePath and FileDescriptor, meant as the single home for low-level system interfaces on every Swift platform. It deliberately isn't a cross-platform abstraction: each OS gets APIs that closely reflect its own interfaces, to make the platform-specific parts of libraries like SwiftNIO and SwiftPM safer and more expressive.

Problems it solves

  • open and write files with file descriptors in Swift
  • call POSIX system APIs safely from Swift
  • low-level file paths in cross-platform Swift code

Features

  • Swift wrappers for system calls
  • FilePath, FileDescriptor and other low-level types
  • per-platform APIs that mirror each OS

Limitations

  • Not a cross-platform abstraction: code still needs #if os() conditionals for platform differences.1