This is something I could get behind as well. I've seen things like this suggested before, but it never goes anywhere.
Clearly Foundation is here to stay, it has decades of work behind it (beginning at NextStep before being acquired by Apple, thus the NS prefix). However, too much of its cross-platform implementation is NSUnimplemented() to really call it cross-platform and many of its APIs are unintuitive and not swifty (just try getting file attributes if you disagree).
Rather than simply porting Foundation directly into swift with all it's flaws, we should redesign it. There is a lot that can be learned from Foundation, but we're not in the 1980s world where it began any more. I think everyone would benefit from a new set of APIs that feel more intuitive and fit better into swift than what we have today with Foundation.
You bring up a good point which leads to my proposed idea:
- Create a new working group, just like the Swift Server Work Group, that is aimed at cross-platform Foundation-like functionality
- Create a swift version of
Boost(name debatable) which will eventually replaceFoundation - Determine the set of functionality that deserves "blessed" support and should be a part of
Boost, but doesn't necessarily belong in the standard library- This will probably just come from what Foundation does today, but may include some extra things and leave out other things
- Begin designing/building this functionality one piece at a time, just like the SSWG is doing
- All functionality should go through an evolution process
- Each piece of functionality will begin as its own separate library before inclusion in
Boost
- Once a library is determined stable on all of Swift's supported platforms merge it into
Boost- Perhaps require ABI stability as well so that anything could potentially be merged into the standard library
We don't have namespacing and so I'm not sure how the process of moving from Boost into the standard library should work. It might just be as simple as remove it from Boost at the same time we add it to the standard library.