[swift-server-dev] Posix Module

Tyler Cloutier cloutiertyler at aol.com
Sun Oct 30 01:29:43 CDT 2016


I think this goes beyond just that proposal, though. It’s not just a problem of conditionally importing both frameworks as there is sometimes a slight mismatch in the API. This results in me having to do unfortunate things like this:

https://github.com/SwiftOnEdge/Edge/blob/8bdbb4555dd49ecfad51498234f4d91cdf07d4aa/Sources/POSIXExtensions/Socket.swift#L18 <https://github.com/SwiftOnEdge/Edge/blob/8bdbb4555dd49ecfad51498234f4d91cdf07d4aa/Sources/POSIXExtensions/Socket.swift#L18>

A standard POSIX Swift API would reduce some serious pain points in developing for the server. All of this translational work from C APIs to Swift APIs is happening in every project that does low level I/O. Ideally it would be as thin a wrapper as is possible while still making the APIs feel Swift-y.

Can you imagine not having to mess about with errno anymore? I dream of the day.

Tyler


> On Oct 29, 2016, at 8:32 PM, Michael Gottesman via swift-server-dev <swift-server-dev at swift.org> wrote:
> 
> Actually swift-evolution. There was a thread about it already:
> 
> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160307/012085.html
> 
> It was only a draft but people IIRC people viewed it favorably (don't quote me on this though, my memory might be wrong). Perhaps no one got behind implementing it? (again my memory is gone).
> 
> Michael
> 
>> On Oct 28, 2016, at 3:56 PM, Daniel Dunbar via swift-server-dev <swift-server-dev at swift.org> wrote:
>> 
>> Given the Glibc overlay lives in Swift, this probably is more appropriate for swift-dev rather than the server APIs project specifically.
>> 
>> - Daniel
>> 
>>> On Oct 28, 2016, at 8:51 AM, Helge Heß via swift-server-dev <swift-server-dev at swift.org> wrote:
>>> 
>>> Hi,
>>> 
>>> I guess this kinda belongs here:
>>> 
>>> I wonder whether we can have a standard Posix module with all the standard Posix stuff in it to avoid the
>>> 
>>> #if os(Linux)
>>>  import Glibc
>>> #else
>>>  import Darwin
>>> #endif
>>> 
>>> for things which are standardised in Posix (and hence the same, even on Windoze). I currently have an `xsys` module to alias the definitions, but this is kinda crap :-)
>>> 
>>> https://github.com/NozeIO/Noze.io/tree/master/Sources/xsys
>>> 
>>> Or is there a better way to do this already?
>>> 
>>> Thanks,
>>> Helge
>>> 
>>> _______________________________________________
>>> swift-server-dev mailing list
>>> swift-server-dev at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-server-dev
>> 
>> _______________________________________________
>> swift-server-dev mailing list
>> swift-server-dev at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-server-dev
> 
> _______________________________________________
> swift-server-dev mailing list
> swift-server-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-server-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20161029/d8b7026f/attachment.html>


More information about the swift-server-dev mailing list