Re:Toward Go 2
by masklinn on Thursday July 13, 2017 @02:36PM
(#14763919)
> The basic tradeoff is monomorphization (code duplication) vs. boxing (in Go speak, interface{}).
And even that is not the whole story, just because you reify generics does not mean you have to monomorphise everything, Microsoft's C# compiler only monomorphises value types.
And even that is not the whole story, just because you reify generics does not mean you have to monomorphise everything, Microsoft's C# compiler only monomorphises value types.
Also Go may box in other contexts than interfaces depending on escape analysis (according to https://golang.org/doc/faq#stack_or_heap).