ML-style generics are less complicated than Go interfaces. There is no reason for Go not to have generics.
Conversation
I tried; I was overruled.
2
Blame me for using <> for generics.
I still think it was the right decision among a bunch of bad choices.
4
1
6
Could you elaborate on the problems you're having with <> being used for generics?
In C++ it sometimes hurts the readability of expressions specified for non-type template parameters, but other than I can't think of any significant issues.
1
It's not clear to me that [] for template parameters would be more readable. Since brackets are also used for array types, indexing operators and lambda capture lists, that syntax wouldn't be conflict-free either, at least in C++. And in the eyes of a C++ programmer '<' being ...
3
Scala uses different notation for array construction and indexing. Seems to work out fine! Here's the ambiguity issue, in Rust at least: github.com/varkor/rust/bl
2
But yeah, shifting things around in the same way for Rust would have other knock on effects, so I won't pretend it's a simple fix or anything. For example Scala's array construction requires variadic arguments, which in turn complicates overloading.
I'm not really seeing this complexity here.
You could just do the same thing as vec! – or realize that varargs are annoying to implement for compiler authors, but a necessary part of a language and add them proper, instead of making people go the macro route to emulate varargs.



