GC shape stenciling in Go generics

🫧 Open on Bubbles While going through the Go generics proposal , I got curious about how the compiler implements it. Compilers usually handle generics in one of two ways: With full monomorphization , the compiler turns generic code into concrete, type-specific code. It generates a separate version for every set of type arguments the program uses. Rust works this way, and so do C++ templates. With type erasure , the compiler keeps one shared version of the generic code and replaces the type parameters with a

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论