Re:Expectations for generics in Go 1.18
by Zababa on Thursday October 28, 2021 @05:25AM
(#29024026)
How does that compare to other approaches for generics? I know that you can do monomorphisation, which usually increases the executable size and compilation time, and usually gives faster code, but I don't know about other approcahes.
[ Parent
| on HN ]
Re:Expectations for generics in Go 1.18
by mseepgood on Thursday October 28, 2021 @06:06AM
(#29024207)
The two approaches are stenciling (what you call monomorphisation) and dictionaries. Stenciling/monomorphization increases binary size, compilation time and TLB/cache pressure. The dictionaries-only approach has more runtime cost. This hybrid is a middle ground of both.