[swift-evolution] [Draft] Unify "import Darwin/Glibc" to simply "Libc"

Stuart Carnie stuart.carnie at gmail.com
Fri Jul 8 11:37:27 CDT 2016


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 <
swift-evolution at swift.org> wrote:

>
> On Jul 6, 2016, at 4:35 PM, David Waite <david at alkaline-solutions.com>
> 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
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160708/a0e38427/attachment.html>


More information about the swift-evolution mailing list