[swift-build-dev] POSIX, Foundation, and layering

Daniel Dunbar daniel_dunbar at apple.com
Thu May 12 11:24:32 CDT 2016


> On May 12, 2016, at 9:15 AM, Ankit Agarwal <ankit at ankit.im> wrote:
> 
> 
> 
> 3. We introduce/rename a new `Basic` module out of `Utility`. This matches a convention used in Clang, Swift, and llbuild for the "base support module". This module will define the "convenient" APIs for system services, shared ADTs, etc. and will sit on top of `libc`, `POSIX`, and `Foundation`. We should try to limit cross-platform adaption code to this layer -- if we need a `Foundation` API, but it is not yet implemented in such a way that use of that API is *syntactically* cross-platform (e.g., it needs different bridging behavior) then we should provide an abstraction in `Basic` that hides that divergence. The goal here is that any code above `Basic` can be written without fear of cross-platform incompatibility (which is a serious burden on developer productivity).
> 
> I agree with all the points. Do you think its better to create new module Basic off of Utility or just rename Utility to Basic? I think it might get confusing to decide where something goes if there are two such modules. Though if definition of Basic is to provide cross-platform I'd imagine Utility contains things like handy extensions to stdlib types and Basic also depends on Utility.

We should basically rename Utility to Basic. How we do that rename is an open question... my inclination is to move each API individually to the "right" place until Utility is empty, then delete it. As part of moving each API we should decide where the right home for it is (POSIX, Basic, or other as-yet-to-be-defined modules).

 - Daniel

>  
> -- 
> Ankit
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20160512/20fa3357/attachment.html>


More information about the swift-build-dev mailing list