3 ms·
> my impression is that the support on Linux within the Foundation is not complete It is not, but it's like 95% of the way there in my experience - most things
by mplewis9z 4y ago
> my impression is that the support on Linux within the Foundation is not complete
It is not, but it's like 95% of the way there in my experience - most things that are missing are relatively recent additions that have some complex OS interactions, like filesystem I/O with language-level concurrency features.
> Does this change imply better (eventual) support on non-Darwin systems?
Yes. The non-Darwin Foundation version is already rewrite that takes a lot of effort to keep in lock-step with the closed-source Objective-C version, so unifying the implementations in Swift will both reduce the amount of maintenance effort and promote non-Darwin platorms to more of a "first-party" status.
> Also, is Foundation the same thing as what one might normally term a standard library?
It's more of a standard library++, including some things that other languages include in their standard libraries (Date/Time models) but also other things that are common to put in third-party libraries (networking, etc.). You do not need to use Foundation for basic things like arrays or concurrency that are built into the normal standard library.
- eatonphil 4y ago> complex OS interactions, like filesystem I/O with language-level concurrency features. Do you mean like io_uring? That wouldn't be too surprising. Even Go doesn't have that in the standard library yet. > so unifying the implementations in Swift will both reduce the amount of maintenance effort and promote non-Darwin platorms to more of a "first-party" status. That's what I was hoping for. Thanks!
- avisser 4y ago<bikeshed> It feels off to call things like Array part of any library when you have array literal syntax `let oddNumbers = [1, 3, 5, 7, 9, 11, 13, 15]` I'd call that a language feature. Or maybe with Swift there is a blurry line between the two?
- saagarjha 4y agoArrays are part of the Swift standard library. Foundation is another library that provides access to things like I/O, networking, calendars, etc.
- mayoff 4y agoArray is defined in the Swift standard library, but the compiler knows about the type directly, and also recognizes various @_semantics("array.blah") annotations that appear in the standard library source code. I believe the semantics annotations are primarily to help the optimizer. https://github.com/apple/swift/blob/main/stdlib/public/core/Array.swift https://github.com/apple/swift/blob/main/stdlib/public/core/...