I would like to add my vote for pushing Foundation as a cross-platform compatibility layer, rather than exposing "Libc". Naturally there is flexibility in designing the APIs to be appropriately Swifty. I would also like to see higher level concepts available via Foundation, like protocols for streams (Readers, Writers, etc) and implementations for files, sockets, compression, encryption, etc. Protocols oriented design will shine. I think the Go standard library would serve as inspiration for some of the design, such as the io package.
Cheers, Stu *Stuart Carnie* On Thu, Jul 7, 2016 at 3:38 PM, Chris Lattner via swift-evolution < [email protected]> wrote: > > On Jul 6, 2016, at 4:35 PM, David Waite <[email protected]> > wrote: > > I see two possible approaches: > > 1. A “import Libc” imports the platform libraries, whatever they may be, > on the OS platform you are on. > > 2. The OS platform libraries are divided up, virtually if necessary, to > expose the underlying standard interfaces without platform-specific > extensions. I imagine that would look similar to > https://gist.github.com/dwaite/c7125680def834e93ba1fae8873ce1f8: > > > I think that it is also important to ask what the real goal here is. > Foundation is our cross platform compatibility layer, are there specific > deficiencies in the Foundation API that cause a problem here, or is it just > that not all of corelibs Foundation is “done” yet? > > -Chris > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution > >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
