[swift-evolution] [Draft] Unify "import Darwin/Glibc" to simply "Libc"
alblue at apple.com
Wed Sep 14 07:59:58 CDT 2016
Vapor's Core package expresses a target called simply 'libc':
As a result, their Swift files simply say "import libc"
> On 13 Sep 2016, at 20:29, Brian Gesiak via swift-evolution <swift-evolution at swift.org> wrote:
> Resurrecting this discussion since the question of "why does Android import Glibc?" came up on this swift-corelibs-foundation pull request: https://github.com/apple/swift-corelibs-foundation/pull/622#discussion_r77848100 <https://github.com/apple/swift-corelibs-foundation/pull/622#discussion_r77848100>
> 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?
> When I first proposed the idea, I simply wanted to turn these five lines:
> #if os(Linux) || os(FreeBSD) || os(Android) || os(PS4)
> import Glibc
> import Darwin
> Into this one line:
> import WhateverNameWeDecideUpon
> After all, writing five lines of code for the import is painful, and the list of `#if os(...) || os(...) || ...` is always expanding.
> I hadn't thought about a unified overlay for POSIX. I think the simplified import alone has benefit to warrant its own evolution proposal. Would it be possible to have a separate discussion for the POSIX overlay idea? Or is there a reason that I'm missing that prevents the import from being viable on its own? (Apologies in advance if there's an obvious answer to this question!)
> - Brian Gesiak
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution