Aaron Schlesinger writes Medium posts about Go and Kubernetes, including the Athens module proxy and a report on generics.
HN links his Go experience report on generics in Kubernetes as an example of how the lack of generics led Kubernetes to build workarounds.
Probably yes: https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301
Many smaller projects would benefit too. I would like to build a typesafe tree for an efficient sorted map, and to be able mergsort over multiple trees of different types. It would allow some extremely useful channel combinators for doing rather common things like safely shutting down a service with some background processing. Often these things leak and a often I find myself spawning more go routines just to map between types or to stop generic interface types infecting the rest of the API.
> Yeah it's hard to write weirdly complicated code in Go
Just because Go lacks many forms of abstraction, doesn't mean complex code will not be created with it. Quite the opposite. It's lack of expressiveness will encourage "frameworks", elaborate encodings, code generation and various productivity aids. Look at what the lack of generics has done to the Kubernetes code base:
"The core team replaced a compile-time language feature that was missing (Generics) with their home-built runtime system"
https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301
> A bunch of pioneer project like docker, kubernetes, etcd, prometheus etc. has been built with go and I don't believe that the maintainers suffered lack of generics and error handlers.
Here's an experience report from k8s: https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301
They've been using a code generator as a work around: https://github.com/google/gvisor/tree/master/tools/go_generics
I would argue while Kubernetes is a great piece of software, and its definitely practical to go in with relatively little experience and tweak a single line or function, Kubernetes is not easy to grok or reproduce in its entirety for example it has its own implementation of generics and a custom type system [1].
[1]: https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301
It's impossible to defend the lack of generics in golang in the face of the fact that two of the larger open source projects both invented their own generics implementations.
https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301
https://github.com/google/gvisor/blob/master/tools/go_generics/generics.go
That particular example of course no, but people writing overengineered beasts to overcome go's limitation happens all the time.
Another famous example is how k8s, dealt with the lack of generics: https://medium.com/@arschles/go-experience-report-generics-in-kubernetes-25da87430301