Better HN
topnewbestaskshowjobs
Log inSign up

paullgdc

1 karma · joined May 18, 2024 (2y ago) · 1 submissions

Submissions

comment 2y ago · link · parent

> get monomorphized copies (not erased to "any") of each function for all concrete types used

That's not exactly true. You get one concrete function for all generic pointer types for instance. Generic functions take a hidden paramater called a dictionnary, which is fairly similar to vtable, since it contains type information and pointers for all methods of the generic type that the function calls.

So methods on generic types are still performed through an indirection.

https://github.com/golang/proposal/blob/master/design/generi...