2 ms·
I think generics on their own are very simple, bordering on second nature. Their interaction with traits (or "interfaces" as some languages call them) can make
by ogogmad 5y ago
I think generics on their own are very simple, bordering on second nature. Their interaction with traits (or "interfaces" as some languages call them) can make them complicated. I guess Go needed to find a way to make that interaction work.
By generics "on their own", I mean essentially the Hindley-Milner type system, which supports generics and can do static type inference in linear time: https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_sy...
Somehow, the "generics wars" in Go made generics into the scapegoat of programming language complexity, when perhaps it was Go's "interfaces" feature all along. Maybe the enemy was here the whole time!