4 ms·
I don't think so. The article explains also that generics as implemented in other programming languages bring a lot of complexity and that generics aren't manda
by emersion 8y ago
I don't think so. The article explains also that generics as implemented in other programming languages bring a lot of complexity and that generics aren't mandatory.
- ernst_klim 8y agoYou already have the complexity in Go, just without type safety. You already have boxing in Go, all interfaces are boxed, so you can easily add Java/OCaml style parametricity without even any changes to your runtime. interface{} is already promoted to heap, they are pointers, all you need is to swap interface with type parameter and add a couple of hundreds lines of code to the type checker. The theory is all in the books and there are dozens of compilers implementing it in practice.