<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="">On Dec 9, 2015, at 5:46 PM, David Farler via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Here's a draft of the proposal:<div class=""><br class=""></div><div class=""><a href="https://github.com/bitjammer/swift-evolution/blob/remove-partial-super/proposals/0008-remove-partial-application-super.md" class="">https://github.com/bitjammer/swift-evolution/blob/remove-partial-super/proposals/0008-remove-partial-application-super.md</a></div></div></div></blockquote><div><br class=""></div><div>Hi David,</div><div><br class=""></div><div>Sorry for the delay, things have been busy lately :-)</div><div><br class=""></div><div>"&nbsp;Currying will be removed in Swift 3.0 so, rather than invest more engineering in those mechanisms, I&nbsp;propose that we disallow partial application of non-final methods through&nbsp;super, except where the&nbsp;self&nbsp;parameter is implicitly captured.”</div><div><br class=""></div><div>This isn’t true. &nbsp;The proposal you’re referring to removes the “func f(a : Int)(b : Int)” syntax, but methods will still be curried. &nbsp;It will still be perfectly legal to do:</div><div><br class=""></div><div>class Foo {</div><div>&nbsp; func bar() {}</div><div>}</div><div><br class=""></div><div>let fn = Foo.bar</div><div>fn()</div><div><br class=""></div><div><br class=""></div><div>So, I think that in a perfect world, the implementation would lazily generate curry thunks for super partial applications, and we would keep the current behavior. &nbsp;However, if it is a significant implementation burden, I’d support doing a survey of existing code to see how widely used this is. &nbsp;I suspect it is rare, and if you can prove this, we may be able to knowingly break compatibility in this case in &nbsp;the service of getting the ABI stability.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">David</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 7, 2015, at 3:37 PM, David Farler &lt;<a href="mailto:dfarler@apple.com" class="">dfarler@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I'd like to add that this would only apply to super invocation of non-final methods. Final methods always terminate with a static function reference, so the existing curry thunk mechanisms will continue to work with those until we remove them.<br class=""><br class="">David<br class=""><br class=""><blockquote type="cite" class="">On Dec 7, 2015, at 1:51 PM, David Farler &lt;<a href="mailto:dfarler@apple.com" class="">dfarler@apple.com</a>&gt; wrote:<br class=""><br class="">Hi all,<br class=""><br class="">I'd like to propose removing partial application of super method calls (except bare `super.foo` which implicitly captures `self`) in Swift 2.2.<br class=""><br class="">This is motivated by the upcoming removal of curried function declaration syntax in Swift 3 combined with making super method calls dynamically dispatched instead of statically dispatched as they are now, which is scheduled to land in Swift 2.2.<br class=""><br class="">The reason why dynamic dispatch is a motivator is mostly driven by implementation details, specifically how we emit partial application thunks. These thunks ultimately result in a static function reference, which is called immediately, or a dynamic dispatch through a class method. Now, you might be wondering how class methods differ from dynamic dispatch via super methods. Class methods use dynamic dispatch through the instance pointer to the class metadata for the vtable lookup, whereas super method dynamic dispatch loads the statically known superclass's metadata instead.<br class=""><br class="">The logic around curry thunk emission is rather complicated so I'd like to go ahead and make partial applications based in `super` disallowed, rather than invest time in an area we'll be ripping up in Swift 3 and increase risk for regressions in Swift 2.2.<br class=""><br class="">The implementation for disallowing this is dead simple and I've already got a patch for that. I should also mention that I can't safely turn on the new dynamic super method dispatch mechanics in Swift 2.2 until we address this one way or the other. I do have progress on emitting curry thunks for these kinds of partial applications but it is a rather large patch that I'd like to avoid for Swift 2.2 if possible.<br class=""><br class="">David<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RC5Cq0zAxCHc1sM9Uy3-2BojrrUAw-2F96zH69NULNHPvCt3G7wq5aFGXitEqdlizYofpTirjxoRJxQrYapq0-2F1B7lLacPO8-2F1fE7HCs2CwE4kem28xVvjOC7-2Fjs-2FSEqPDFb4L3dzpLxhO4ZntNgZyA9lvJaAI3lhTUGem4lA4bNnkE60PJBNeSPFk6Aepi5Gb6DViiL9BA7qX2hLkIxJveVzZ2TibShixUoJpMrzAiVS7M-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="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>