Re:Static types in Python
by duaneb on Thursday October 13, 2016 @10:41PM
(#12705820)
Most static typing systems have no parallel to 'deriving', which is to my understanding compile-time computation (aka a macro).
[ Parent
| on HN ]
"deriving" is compile time; "Generic" is runtime inspection of the shape of a value (in terms of constructor applications). Something (at least vaguely) similar to Generic exists in many statically typed languages - including (IIRC, IIUC) Java and Go.
> Something (at least vaguely) similar to Generic exists in many statically typed languages - including (IIRC, IIUC) Java and Go.
Sure—but it's in spite of static typing, not because of it. You certainly give up any guarantees of avoiding runtime errors by detecting typing issues at compile time.