Following Requirements for IP address and port APIs - #8 by MahdiBM, an agenda item I'd like to propose is to settle on what platform requirements we'd like to have, and what platforms we'd like to exclude. Specifically about Apple platform requirements where new APIs can be tied to OS versions.
Do we want to support macOS 26 and above? 15 and above? 13 and above?
SwiftPM in Swift 6.4 assumes a minimum of macOS 12 by default so that's the lowest we should consider (not sure if you can or cannot write applications for e.g. macOS 10.15 in it).
Notable macOS requirements that I've noticed:
- macOS 26:
InlineArray. Can sometimes be worked around with APIs which require closures, such aswithUnsafeTemporaryAllocationwhich hands you a stack-allocated pointer.UTF8Span(String.utf8Span). Can be worked around unless you need specificUTF8Spanfunctionalities likecheckNFC().- Even for
checkNFC(), you could simply implement it yourself, just that it's a lot of trouble to do so manually. Requires unicode understanding and lookup tables.
- Even for
- Some other
.spanimplementations likeArray.span: All can be worked around by using existingvalue.withUnsafe*PointerAPIs and calling.span/.mutableSpanon the pointer.
- macOS 15:
Mutex,Atomic(Synchronizationmodule): Not a blocker since there are a lot of other impls (like swift-nio'sNIOLock, or swift-atomics).UInt128: Can be hard to work around, can need you to manually roll your own type backed by 2UInt64s.- swift-endpoint contains its own
UInt128impl (UnsignedInteger128) for this reason.
- swift-endpoint contains its own
- macOS 14:
SerialExecutor: Not a blocker, can be worked around.withDiscardingTaskGroup: Not a blocker, can be worked around.
- macOS 13:
Clock,Duration: Generally required for proper networking, but swift-endpoint specifically doesn't need any of them.
- macOS 11:
String(unsafeUninitializedCapacity:initializingUTF8With:): Required for performant initialization ofStrings.
- macOS 10.15 (or maybe 10.14 / lower):
- Structured Concurrency APIs such as
Task. Required for proper "modern" networking. - Backdeployed
SpanAPIs. Pretty much required. (One could useUnsafePointers instead if they really want to).
- Structured Concurrency APIs such as