swift-system
swift-system copied to clipboard
Added Time types
Added Time, TimeInterval and Clock types for interfacing with System time.
I suspect this is redundant with the proposed Time management types for the standard library: https://forums.swift.org/t/pitch-clock-instant-date-and-duration/52451
Well, we need some kind of wrapper to interface with these C APIs. It's my understanding that this library should wrap the C std lib APIs, like Foundation is a wrapper for CoreFoundation, ICU, cURL and libXML. If the functionality is part of the Swift standard library, thats great, but it should not depend on Glibc, Darwin, etc. System
should provide Swift overlays for Darwin and Glibc C APIs.
The Swift standard library should and does depend on libc when appropriate.
It's my understanding that this library should wrap the C std lib APIs, like Foundation is a wrapper for CoreFoundation, ICU, cURL and libXML.
Nope.
SwiftSystem
is a wrapper on, and a helper around system programming APIs, not the C standard library. The C standard library is already wrapping up mostly-used system APIs and it has a significantly higher abstraction level than what System
provides.
Typically, we would encourage library designers to wrap up C APIs according to their use cases. There are plenty of existing best practices, especially server-side libraries.