4 ms·
Most static typing systems have no parallel to 'deriving', which is to my understanding compile-time computation (aka a macro).
by duaneb 10y ago
Most static typing systems have no parallel to 'deriving', which is to my understanding compile-time computation (aka a macro).
- dllthomas 10y ago"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.
- duaneb 10y ago> 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.
- dllthomas 10y agoSure, it's orthogonal to static typing (I wouldn't quite say "in spite of"). I wasn't trying to weigh in on the general topic, just to clarify what was happening where.