<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 Jan 3, 2016, at 10:25 AM, Антон Жилин via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">The problem with syntax of "existential protocol" and "protocol" is that the first should actually be default, and easier to write.<br class=""></div><div class=""><br class=""></div><div class="">We should prefer static to dynamic. </div></div></div></blockquote><div><br class=""></div><div>These two statements seem to be in conflict: existentials create dynamic polymorphism, while generics create static polymorphism.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">It is as if "structs" had to be declared as "static class", or "let" variables as "const var". Shorter keywords should be used for enforcing good practices.</div><div class="">Additionally, 95% of standard library protocols are actually "existential protocols", or "protocols" in my notation.<br class=""></div><div class=""><br class=""></div><div class="">Next, I don't know any language which has "existential" keyword. Moreover, "existential types" in Haskell mean means (roughly) "type that can hold value of any instance of class with type erasure", and that is exactly what an interface is in Swift. So, I think that if we will add "existential" keyword, we would add it the other way: for dynamically dispatched types.</div><div class=""><br class=""></div><div class="">Some other suggestions (imagine a table):</div><div class=""><br class=""></div><div class="">statically dispatched - dynamically dispatched</div><div class="">protocol - interface</div><div class="">protocol - dynamic protocol</div><div class="">protocol - existential protocol</div><div class="">static protocol - dynamic protocol</div><div class="">trait - protocol</div><div class="">trait - interface</div><div class=""><br class=""></div><div class="">I also personally like the "trait - protocol" naming. Traits are used to be statically dispatched things in other languages, and protocols are dynamically dispatched things from Objective-C. Actually, I'm satisfied with any pair unless dynamic protocols get shorter names.</div><div class=""><br class=""></div><div class="">P.S. I'll correct that Self issue, thanks!</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=JfMPa-2F7wwZPzsZ3QKA8NjtONIYX4SjbWuUxtpfsTY2gM-2BCPUSxtW-2FlWCV86mfZyc3CPblE4NW39cRijOwIxHztfa2Yb-2FUzFS844lOYW2vQvfCx-2BTtnnTONLPZ6y54-2BFPEBb3vs-2FtnMAmtki8X-2Fti4vpmeRcYsSkbY2V0SrU6lMLprurRD5nF6kpIo1vtv6F5ahrg-2B2v5rRtbpbtqBOBBSeHyyyDaSQtRUSVcVdbvph8-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-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=""><div class="">
-Dave
</div>
<br class=""></body></html>