<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="">I just sent this to swift-evolution. TLDR: LibraryEvolution.rst is ready for wider review and comments.<div class=""><br class=""></div><div class="">(Of course Slava's been hard at work implementing all this for the last few weeks already, but that doesn't make the model any less important!)</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Jordan</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt;<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[RFC] "Library Evolution Support in Swift ('Resilience')"</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">February 8, 2016 at 18:24:15 PST<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;<br class=""></span></div><br class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi, swift-evolution. We've been making references for a while to "resilience" as a cornerstone of the Swift 3.0 work, the collection of features that allows a library to evolve over time while maintaining binary compatibility. Among other things, this is necessary if we want to stop bundling the Swift standard library with any app that uses Swift, a noted complaint from iOS developers. :-)</div><div class=""><br class=""></div><div class="">If you're wondering what this is all about, take a look at the prologue for the design document:</div><div class=""><br class=""><blockquote type="cite" class="">One of Swift’s primary design goals is to allow efficient execution of code without sacrificing load-time abstraction of&nbsp;implementation.<br class=""><br class="">Abstraction of implementation means that code correctly written against a published interface will correctly function when the&nbsp;underlying implementation changes to anything which still satisfies the original interface. There are many potential reasons to&nbsp;provide this sort of abstraction. Apple’s primary interest is in making it easy and painless for our internal and external developers to&nbsp;improve the ecosystem of Apple products by creating good and secure programs and libraries; subtle deployment problems and/or&nbsp;unnecessary dependencies on the behavior of our implementations would work against these goals.<br class=""><br class="">Our current design in Swift is to provide opt-out load-time abstraction of implementation for all language features. Alone, this would&nbsp;either incur unacceptable cost or force widespread opting-out of abstraction. We intend to mitigate this primarily by designing the&nbsp;language and its implementation to minimize unnecessary and unintended abstraction:<br class=""><br class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• Avoiding unnecessary language guarantees and taking advantage of that flexibility to limit load-time costs.<br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• Within the domain that defines an entity, all the details of its implementation are available.<br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• When entities are not exposed outside their defining module, their implementation is not constrained.<br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• By default, entities are not exposed outside their defining modules. This is independently desirable to reduce accidental API&nbsp;surface area, but happens to also interact well with the performance design.<br class=""></div></blockquote><blockquote type="cite" class=""><br class=""></blockquote><blockquote type="cite" class="">This last point is a specific case of a general tenet of Swift:&nbsp;<b class="">the default behavior is safe</b>. Where possible, choices made when an&nbsp;entity is first published should not limit its evolution in the future.</blockquote></div><div class=""><br class=""></div><div class="">RFC stands for "request for comments", and that's what this is: I'd appreciate the eager and discriminating eyes of swift-evolution on this model. It is quite long—nearly ten thousand words—and attempts to be fairly precise in describing what is and isn't allowed, so feel free to focus on the parts that interest you most. This isn't a proposal and won't be going through the Swift Evolution Process, but many existing or planned proposals will affect or support the model described here. (There's a list of them at the end of the document.)</div><div class=""><br class=""></div><div class="">The document is written in ReStructuredText to match the rest of the compiler documentation, but it's using some features from the Sphinx system that GitHub's ReST renderer doesn't support. Consequently, I've put up a&nbsp;<a href="http://jrose-apple.github.io/swift-library-evolution/" class="">rendered form</a>, which I'll update every few days when there are changes. (This is pretty much the same rendering you get from running "make" in the docs/ directory in the Swift repo.) The canonical document is still the one&nbsp;<a href="https://github.com/apple/swift/blob/master/docs/LibraryEvolution.rst" class="">in the Swift repository</a>.</div><div class=""><br class=""></div><div class="">Looking forward to your feedback!</div><div class="">Jordan</div></div></div></blockquote></div><br class=""></div></body></html>