[swift-evolution] [Draft] Unify "import Darwin/Glibc" to simply "Libc"
clattner at apple.com
Wed Nov 30 17:12:57 CST 2016
> On Nov 30, 2016, at 1:13 AM, Tyler Cloutier <cloutiertyler at aol.com> wrote:
>> I think we should formally decide that a “nice” wrapper for libc is a non-goal. There is too much that doesn’t make sense to wrap at this level - the only Swift code that should be using this is the implementation of higher level API, and such extremely narrow cases that we can live with them having to handle the problems of dealing with the raw APIs directly.
> I don’t know, I kind of take issue with the last point there. I don’t think it’s a foregone conclusion that applications and frameworks aren’t going to need to be using these APIs.
I respect your opinion, and I agree that it would be “useful” to have a nicer wrapper for POSIX. That said, I stand by the claim that "we can live with this”. We have to pick and choose the battles that are tackled, because we don’t have infinite design bandwidth. Perhaps a better way of saying the above would be say that we should “start” with high level APIs, and see how far that takes us. After exploring those and building out the obvious things needed at higher levels, we can see what is left unaddressed, and decide then whether it makes sense to cover the remaining use cases with a POSIX wrapper or something else.
> As I understand it’s not the goal of Foundation to provide all of the functionality of POSIX. And I know of at least 5 serverside and/or networking libraries which each provide their own abstractions over the POSIX interface. Unfortunately I think that breed incompatibility that bubbles up from underneath.
I agree that this is a huge hole in our story, but fortunately this is one of the primary things that the swift server working group is aiming to fix!
More information about the swift-evolution