<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Jacob,<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 3, 2015, at 2:23 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 3, 2015 at 2:13 PM, Chris Lattner <span dir="ltr" class="">&lt;<a href="mailto:clattner@apple.com" target="_blank" class="">clattner@apple.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br class="">
As others have surmised, the goal for the Swift Foundation project is to provide a pure-swift implementation (which reuses widely-available C libraries) of important Foundation APIs that do *not* depend on the Objective-C runtime.&nbsp; Reusing GNUstep, Cocotron, or even Apple’s existing Foundation implementation didn’t allow us to achieve those goals, so we didn’t go with those approaches.<br class=""></blockquote><div class=""><br class=""></div><div class="">This is great, but is the goal also to exactly duplicate all the idiosyncrasies of the Obj-C Foundation?</div><div class=""><br class=""></div><div class="">Quiz: what's the result of&nbsp;<span class="">NSURL</span><span class="">(string: </span><span class="">"<a href="http://one/two;three/four" class="">http://one/two;three/four</a>"</span><span class="">)?.</span><span class="">URLByAppendingPathComponent</span><span class="">(</span><span class="">"five"</span><span class="">)</span>&nbsp;?</div><div class=""><br class=""></div><div class="">If, as I would hope, corelibs-foundation is an opportunity to make simpler APIs that resolve some of these weirdnesses, then should the class names (NSURL, NSFileHandle, etc.) really be the same?</div><div class=""><br class=""></div></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=U7z7oSqRMSwdl2rYt9JJ4zIFaeg4R-2FxExg9xndDuCbw6pu8mPlP6tk2M55gscvSbsiO0Xh4-2FilS31WP15uOf9HDzgFud3tZy-2FWLrVkkSRF5Kby67wyR6KKwgn-2Bfwqi8i-2F4mqoPA7tbsSW0njDeoeKc0TeejIT1-2FWXf6JKtZk6wlsFCB2-2FjrKTe3-2BOpeAW0f3DjTOzFd-2FEsLE99ALsh7V-2BftCARiWjHNKGqjyq9nDkbk-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></blockquote></div><br class=""></div><div class="">I think NSURL is actually a pretty great example of an API that we want to be the same on all platforms. There is quite a bit of logic backing it (along with something like NSURLComponents). Check out some of it here:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/URL.subproj/CFURLComponents_URIParser.c" class="">https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/URL.subproj/CFURLComponents_URIParser.c</a></div><div class=""><br class=""></div><div class="">(and that CF code is reflected up into NSURLComponents)</div><div class=""><br class=""></div><div class="">It’s tricky stuff, and the goal is to get it as standards compliant as possible. If we use this implementation for all Swift clients then we can get a consistent answer everywhere - and even better, fix bugs everywhere at the same time.</div><div class=""><br class=""></div><div class="">So if you find some of the interface confusing (or wrong), then file a bug for us at <a href="http://bugs.swift.org" class="">bugs.swift.org</a>. We can take this opportunity to try to make it better for everyone.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">- Tony</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>