Generics should be based on models
benjamingr opened this issue · 1 comments
Please see: http://dl.acm.org/citation.cfm?id=2738008 by Barbara Liskov:
The support for generic programming in modern object-oriented programming languages is awkward and lacks desirable expressive power. We introduce an expressive genericity mechanism that adds expressive power and strengthens static checking, while remaining lightweight and simple in common use cases. Like type classes and concepts, the mechanism allows existing types to model type constraints retroactively. For expressive power, we expose models as named constructs that can be defined and selected explicitly to witness constraints; in common uses of genericity, however, types implicitly witness constraints without additional programmer effort.
I think what they did there is pretty cool - I'm sorry if this is the incorrect place to stop but I couldn't find a place to comment in /proposals and I didn't find an appropriate issue here.
The top of https://github.com/golang/proposal/blob/master/design/15292-generics.md has a line:
"Discussion at https://golang.org/issue/15292"
Feel free to copy your comment to #15292