3 ms·
You 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
by ernst_klim 8y ago
You 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.