Re:TypeScript for Pythonistas
by ninkendo on Friday December 17, 2021 @04:47PM
(#29598749)
Duck typing can still be a compile-time thing… C++ templates are “duck typed” in that the template can’t specify the bounds for the passed-in type, but if you pass the wrong type, it still breaks at compile time instead of runtime. (It’s just that the error messages are way more impenetrable than they otherwise could be.)
[ Parent
| on HN ]
I’d argue that either “runtime is compile time in the case of C++ templates” and/or “C++ templates are structurally typed”, especially now that concepts are a thing.
ETA: and/or that talking about C++ templates as "typed" one way or another is problematic, given that they're a part of the type system.