Hacker News new | ask | show | jobs
by fanf2 1990 days ago
My understanding from the “Featherweight Go” paper https://arxiv.org/abs/2005.11710 is that generic types will not simply be a synonym for interface{} because the compiler will be able to monomorphize them - they do not require dynamic dispatch like interfaces.
2 comments

> My understanding from the “Featherweight Go” paper https://arxiv.org/abs/2005.11710 is that generic types will not simply be a synonym for interface{}

The `any` constraint is a synonym for the `interface{}` constraint.

I think the comment above meant that the `any` keyword specifically is a synonym for `interface{}`, not that all generic types will be.