Re:Generics can make your Go code slower
by dse1982 on Wednesday March 30, 2022 @02:29PM
(#30858977)
This is a very interesting article. I was however a bit confused by the lingo, calling everything generics. As I understood it the main point of the article quite precisely matched the distinction between generics and templates as I learned it. Therefore what surprised me most was the fact that go monomorphizes generic code sometimes. Which however makes sense given the way go's module-system works – i.e. imported modules are included in the compilation – but doesn't fit my general understanding of generics.
[ Parent
| on HN ]
Re:Generics can make your Go code slower
by ben0x539 on Thursday March 31, 2022 @03:01AM
(#30864587)
Rust also enthusiastically monomorphizes generic code. Templates vs generics seems to be more about the duck typing C++ templates use vs generics doing type parameters with statically checked constraints on the types.