swift-system icon indicating copy to clipboard operation
swift-system copied to clipboard

Added Time types

Open colemancda opened this issue 2 years ago • 4 comments

Added Time, TimeInterval and Clock types for interfacing with System time.

colemancda avatar Oct 30 '21 01:10 colemancda

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

Lukasa avatar Oct 30 '21 19:10 Lukasa

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.

colemancda avatar Oct 30 '21 19:10 colemancda

The Swift standard library should and does depend on libc when appropriate.

Lukasa avatar Oct 31 '21 06:10 Lukasa

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.

stevapple avatar Jan 24 '22 17:01 stevapple