I guess not all of us feel that it was so drawn-out. Perhaps by swift's standards.
Personally, I've felt for a while that swift moves too quickly. Things go almost immediately from "good idea" to "let's ship this in the next release of the standard library". That will hopefully be addressed by the new preview library:
Adding these packages serves the goal of allowing for rapid adoption of new standard library features, enabling sooner real-world feedback, and allowing for an initial period of time where that feedback can lead to source- and ABI-breaking changes if needed.
At the same time, you can make a reasonable argument that Swift also moves too slowly (without it being a contradiction). We still have a lot of work to do in order to provide a pleasant interface to basic functionality.
Personally, I think the major job of the standard library is to provide interface types. Whatever other types or algorithms your module uses internally is its own business, but when it comes to interfacing with other modules, everybody needs to agree on what an Array
is, for instance. However, it's (more-or-less) OS neutral, so it doesn't help with lots of the code we actually write. With that in mind, if you think Swift moves too slowly, I think you need to look beyond the standard library:
-
Foundation needs a radical refresh. It has an important role in the ecosystem, as it provides the interface types for OS-level functionality (like the filesystem), like the standard library does for generic types and algorithms. You definitely want all modules to have the same understanding of FS primitives. However, the current interface doesn't fit well with modern Swift, it's not very pleasant to use, and there's nothing we (the community) can do about it. I think Apple's arguments against an open evolution process have become weaker, since the Swift standard library is now also a Darwin system library. There's no reason for the new Foundation to be less open than the standard library. Maybe this time we'll even get an
OrderedSet
-
We also need a new library (let's call it
Basic
), for important non-interface types and functionality. This would include useful collections likeBTree
, and modern interfaces for things like command-line parsing. The reason this is not part of Foundation is so that its version can float, and so that it can be back-deployed to older Darwin OSes.
In other words:
Stable | Floating | |
---|---|---|
Generic | stdlib | stdlib-preview |
OS-level | Foundation | "Basic" |
The major difference between a "Basic" package and stdlib-preview, is that things in the preview package are expected to become stable and migrate to the stdlib eventually. Things in Basic wouldn't necessarily have that expectation.