<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 18, 2017, at 5:42 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On Fri, Aug 18, 2017 at 7:39 PM, Taylor Swift<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:kelvin13ma@gmail.com" target="_blank" class="">kelvin13ma@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class="h5"><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Aug 18, 2017 at 8:09 PM, Xiaodi Wu<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><span class="">On Fri, Aug 18, 2017 at 6:55 PM, Greg Parker<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:gparker@apple.com" target="_blank" class="">gparker@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 17, 2017, at 5:16 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class="m_3781229052794196898m_-9206094417763070344m_-160126522738321039Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Thu, Aug 17, 2017 at 6:46 PM, Taylor Swift<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:kelvin13ma@gmail.com" target="_blank" class="">kelvin13ma@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="">I don’t think the “is this library functionality or standard library functionality” argument is worth having, but if<span class="Apple-converted-space"> </span><span style="font-family: monospace, monospace;" class="">stdout</span><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><span style="font-family: monospace, monospace;" class="">stdin</span><span class="Apple-converted-space"> </span>are first-class citizens in the Swift world, so should<span class="Apple-converted-space"> </span><span style="font-family: monospace, monospace;" class="">stderr</span>.<br class=""><br class=""></div>As for bringing Foundation into the discussion, you can’t really talk about Foundation without also talking about the mountains of problems that come with the monolith pattern. But that’s a completely different conversation to be had.<br class=""></div></blockquote><div class=""><br class=""></div><div class="">I'm not sure what you're getting at here, but I don't believe you've addressed my question, which is: it's been firmly decided that I/O belongs in Foundation, and Foundation does in fact offer such facilities--what is missing from those facilities, and how can we fill it out?</div></div></div></div></div></blockquote><br class=""></div></span><div class="">Lots of I/O functionality is missing from Foundation. Foundation's design from time immemorial is that generally only relatively simple and high-level operations are available in Foundation itself, and if you want to do complicated or non-portable things then you are expected to drop down to POSIX or other C interfaces. That design works less well in Swift than it did in Objective-C because Swift's interface with C, especially low-level C, is often ugly.</div><br class=""><div class="">Simple example: there is no way to access file information directly via NSFileHandle. You need to call NSFileHandle.fileDescriptor and pass that to fstat() or fcntl(). The NSFileHandle API in general is sparse and wholly inadequate for sophisticated I/O.</div></div></blockquote><div class=""><br class=""></div></span><div class="">So that's a good starting point for the discussion.</div><div class=""><br class=""></div><div class="">What, in your opinion, should be the way forward in addressing this situation? Is there a realistic chance of writing a single comprehensive, cross-platform API that makes possible currently "complicated or non-portable things" on both macOS/iOS/tvOS/watchOS and Linux, and potentially Windows? If so, does that fit within the general category of filling out the currently sparse Foundation APIs or would that be a matter for a separate library? In the alternative, is it the right solution to make dropping down to POSIX marginally easier by re-exporting C APIs under a unified name, without attempting a single cross-platform API?</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div></blockquote></div></div><div class="gmail_extra"><br class=""></div></div></div><div class="gmail_extra">For what it’s worth, CoreFoundation appears to support windows environments, at least for things like path manipulation. However atm it’s not very relevant as Swift doesn’t run on Windows rn.<br class=""></div></div></blockquote></div><br class=""></div><div class="gmail_extra">If I recall, the CoreFoundation code for Windows is from a long-abandoned port that no longer works, to the point that it is thought unsuitable as a basis for a modern port.</div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>I don’t think abandoned is the right term per-se. But the branch of CoreFoundation that is used for the CF inside of swift-corelibs-foundation has moved in a different direction than the one being used for the Windows support (might be better to think of it as a fork that diverged). I would definitely agree that anything of an update for windows support should definitely reach out and work together to see what we can and should update. But as it stands - I don’t think that is fully operational at the current point in time (modulo perhaps Cygwin; which recently had some contributors working on that front).</div><div><br class=""></div><div>If a contributor wants to revitalize the windows portion I would be very willing to aide in that endeavor.</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>