<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="">First of all, great proposal :D<div class=""><br class=""></div><div class="">Brent, earlier in the thread makes a lot of good points. But I’d still like to discuss two subjects:</div><div class=""><br class=""></div><div class="">1) What makes the proposal really stand on its feet compared to third-party libraries is the compiler generation magic. I feel divided about it. On one hand, this is the only solution today to have this level of type and key safety. But on another hand, I have the impression that future versions of Swift (with more reflection, property behaviours, lenses, etc…) would dramatically affect how this subject is treated and implemented. Are you worried that we are asking the compiler to do work which might be un-necessary in the future? That this topic would be better expressed with more powerful language features? Any plans to migrate for this API to smoothly migrate to those features in the future?</div><div class=""><br class=""></div><div class="">2) Libraries like Marshal (<a href="https://github.com/utahiosmac/Marshal" class="">https://github.com/utahiosmac/Marshal</a>) and Unbox (<a href="https://github.com/JohnSundell/Unbox" class="">https://github.com/JohnSundell/Unbox</a>) don’t require the decoding functions to provide the type: those functions are generic on the return turn and it’s automatically inferred:</div><div class=""><br class=""></div><div class="">func decode<T>(key: Key) -> T</div><div class=""><br class=""></div><div class="">self.stringProperty = decode(key: .stringProperty) // correct specialisation of the generic function chosen by the compiler</div><div class=""><br class=""></div><div class="">Is there a reason the proposal did not choose this solution? Its quite sweet.</div><div class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="" applecontenteditable="true"><div class=""><h1 id="toc_0" style="-webkit-print-color-adjust: exact; margin: 0px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 28px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Swift Archival & Serialization</h1><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Proposal: <a href="https://github.com/apple/swift-evolution/pull/639" class="">SE-NNNN</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Author(s): <a href="https://github.com/itaiferber" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">Itai Ferber</a>, <a href="https://github.com/mlehew" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196);" class="">Michael LeHew</a>, <a href="https://github.com/parkera" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196);" class="">Tony Parker</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Review Manager: TBD</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Status: <strong style="-webkit-print-color-adjust: exact; margin-top: 0px;" class="">Awaiting review</strong></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Associated PRs:<ul style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px; padding-left: 30px;" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><a href="https://github.com/apple/swift/pull/8124" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">#8124</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><a href="https://github.com/apple/swift/pull/8125" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">#8125</a></li></ul></li></ul></div></div></blockquote></div></div></div></body></html>