Earlier this week, Joe Groff of the Swift Core Team published a massive
discussion post on the Swift forums. It discussed a lot of
possible changes to the way that generics work in the Swift language, and kicked
off the process with a link to SE-244, a proposal to introduce some
features around function return values. The post as a whole was an absolutely
fascinating read, and made a really compelling case for some powerful new ideas
that might come to Swift.
In discussing this post with some colleagues, though, it’s become clear that the
intended audience is a little more embedded into the theory and technical
details of programming language evolution than your average Swift developer.
There’s nothing wrong with that — it’s reassuring to know that the folks driving
changes in Swift have a solid background in language design, and that they’re
thinking about all manner of hard problems in order to make our lives easier.
However, it makes me worry that people might be missing out on a truly exciting
conversation about what might be coming in a future Swift version.
To that end, this post aims to walk through some of the proposals from Joe’s
document, explaining the syntax and offering examples of how the changes to
generics might look in practice. We’ll pick up a couple technical terms in a
practical setting, and wrap up with some details about the open Swift Evolution
proposal(s) being considered.