Hacker News new | ask | show | jobs
by uluyol 1631 days ago
It was a design goal that monomorphization should always be possible, but Go will not be monomorphizing generic functions to save on compile time / binary bloat (it will instead use GCShape stenciling, see below). I suspect future releases will be smarter and monomorphize some functions for performance, but that's really up to the Go team.

Initial implementation strategies considered for generics: https://github.com/golang/proposal/blob/master/design/generi... https://github.com/golang/proposal/blob/master/design/generi... https://github.com/golang/proposal/blob/master/design/generi...