Introduction of new keyword 'any' for protocol conforming arguments

Thanks for your comments @gwendal.roue, @itaiferber. It's helped clarify my ideas. I feel I have to go "full Cassandra" though to try to avoid what could be a sticky situation later in the year and beyond (prophesied by this tweet)

The nub of SE-0335 is to deprecate unwitting use of existentials in passing arguments due to perceived performance concerns. I get that, but having moved this usage to one side by introducing a new any keyword what is the fate of the so-called "naked protocol" syntax for specifying a conforming argument? Deprecation would leave a bit of a crater in the language which I feel we should backfill with the tactical rewriting I propose to avoid a good deal of disruption. This also fits with my belief a developer shouldn't have to know generics to be able to use protocols. Otherwise, depending on the fixit I anticipate the uninitiated will simply slavishly add any locking the inefficient existential signature into their code.

I've said my piece and I'm not going to get agitated about this but I feel the introduction of this feature could be better staged or postponed until opportunities like "opening existentials" can be realised to reduce the disruption of this change to the broader Swift community.

2 Likes