GC shape stenciling in Go generics
Summary
Go generics are implemented using GC shape stenciling, a middle ground between full monomorphization and type erasure. The article explains how the compiler reuses function bodies across types with the same GC shape, introduces the concept of dictionaries for exact types, and discusses performance implications and compiler behavior.