<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 19, 2016, at 10:02 PM, Dan Appel <<a href="mailto:dan.appel00@gmail.com" class="">dan.appel00@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">>Swift 2.2 code should be run through a migrator, which is able to automatically handle changes like this.</div><div class=""><br class=""></div>Yes, but that's not really my point. Why do it this "magical" way? </div></div></blockquote><div><br class=""></div><div>Because it means that there is exactly one API: not a canonical API and a similar-but-different and less efficient wrapper. The approach taken here generalizes to other (similarly structured) C APIs as well.</div><div><br class=""></div><div>As I mentioned before this isn’t about breaking code, so let me flip your question around: Why not do it? </div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">It's already possible (and actually very easy) to wrap C modules such as libdispatch in a Swifty API (see <a href="https://github.com/VeniceX/Venice" class="">Venice</a>, <a href="https://github.com/Zewo/OpenSSL" class="">OpenSSL</a>, <a href="https://github.com/Zewo/PostgreSQL" class="">PostreSQL</a> as examples). I know that LibDispatch is special to Swift and Apple, but I just don't see a reason to give it such a special treatment.<div class=""><br class=""></div><div class="">Dan</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, May 19, 2016 at 9:56 PM Chris Lattner <<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
> On May 19, 2016, at 9:53 PM, Dan Appel <<a href="mailto:dan.appel00@gmail.com" target="_blank" class="">dan.appel00@gmail.com</a>> wrote:<br class="">
><br class="">
> Does this mean that all current code using Dispatch is broken?<br class="">
<br class="">
Are you asking about Swift 2.2 code?<br class="">
<br class="">
Swift 2.2 code is generally completely incompatible with Swift 3 for a lot of other reasons (e.g. major changes to the standard library APIs). Swift 2.2 code should be run through a migrator, which is able to automatically handle changes like this.<br class="">
<br class="">
-Chris</blockquote></div><div dir="ltr" class="">-- <br class=""></div><div class=""><div dir="ltr" class=""><div class=""><div class="">Dan Appel<br class=""></div></div></div></div>
</div></blockquote></div><br class=""></body></html>