upvote
More specifically, it is because of interface type assertions – the fact that if you have a value of some interface type (e.g. `any`), you can dynamically assert that it is another interface type (e.g. `io.Reader`). A good example of that is `io.Copy`: https://cs.opensource.google/go/go/+/refs/tags/go1.26.3:src/...

This aspect is what prevents you from statically knowing which interface-implementations you need to generate for a specific concrete type. There could always be new ones added at runtime.

reply
> for want of a better word

Structural typing is the term typically used to describe "static duck typing".

reply
I’d describe structural typing as a special case of duck typing FWIW.
reply
I suppose. That special case is that it is evaluated statically, whereas duck typing is evaluated dynamically. That's the whole difference between them. They are otherwise identical concepts.

But who is to say that dynamic evaluation isn't the special case?

reply