I have read this article which indicates a double tuple structure, but it is unfortunately light on implementation details, which is what I am looking for.
So... how are interfaces implemented in Go?
Pure guesswork on my part:
- It cannot be a v-table in the C++ sense, because the interface is implicit - a struct doesn't know it conforms to an interface when compiled, only when passed to a function taking an interface does this actually happen.
- I don't think it can be static polymorphism - every function that takes an interface parameter would have to be compile-time aware of every type that might be passed to it and I don't think that's true either.
What else is left?