Does anybody know why there is no real support for generics/templates/whatsInAName in Go? So there is a generic map
, but that's supplied by the compiler, while a Go programmer can't write her own implementation. With all the talk about making Go as orthogonal as possible, why can I USE a generic type but not CREATE a new one?
Especially when it comes to functional programming, there are lambdas, even closures, but with a static type system lacking generics, how do I write, well, generic higher order functions like filter(predicate, list)
? OK, Linked lists and the like can be done with interface{}
sacrificing type safety.
It looks like generics will only be added to Go as an afterthought, if at all,. I do trust Ken Thompson to do way better than the Java implementers, but why keep generics out? Or are they planned and just not implemented yet?