3 ms·
An inverse function. While technically used like types, TypeScript "types" are really compile-time values that happen to be also usable for constraining usual
by lifthrasiir 2y ago
An inverse function.
While technically used like types, TypeScript "types" are really compile-time values that happen to be also usable for constraining usual run-time values like types. These compile-time values themselves do not have much types, so you can easily get errors from compile-time evaluations (which is different from compile-time type errors!). Likewise, most TypeScript type-level constructs are really long-winded methods to do the compile-time computation and have no straightforward equivalents in type systems that do guarantee the soundness and coherence (which have specific definitions).
- Kinrany 2y agoSince there's no previous stage where compile-time expressions could be type checked, the best they can have is strong dynamic typing, no?
- lifthrasiir 2y agoNot quite, because the previous stage can be dynamically generated as needed.