5 ms·
It can be found in many libraries in the ecosystem, and is common enough in the standard library. The lack of generics just severely restricts the expressivene
by the_duke 7y ago
It can be found in many libraries in the ecosystem, and is common enough in the standard library.
The lack of generics just severely restricts the expressiveness of the type system.
I think the best way to work around this is use of code generation, which is a great tool for internal, controlled environments, but very cumbersome for open source libraries.
- enneff 7y agoI don’t see much, if any, generated Go code at Google. Not to say that it doesn’t happen but it’s not on my radar.
- zigara 7y agoHere is an example: https://github.com/google/gvisor https://github.com/google/gvisor - https://github.com/google/gvisor/tree/master/tools/go_generics https://github.com/google/gvisor/tree/master/tools/go_generi... It was useful enough that someone made a standalone package: https://github.com/mmatczuk/go_generics https://github.com/mmatczuk/go_generics
- pjmlp 7y agoKubernetes makes heavy use of generated code, as workaround for lack of generics. They even gave a FOSDEM talk about this, with a very interesting title. https://fosdem.org/2019/schedule/event/kubernetesclusterfuck/ https://fosdem.org/2019/schedule/event/kubernetesclusterfuck...
- dnautics 7y agoAren't http or grpc apis autogenerated? You'd be crazy not to use a generator for those.
- deleted 7y ago[deleted]