4 ms·
> TypeScript doesn't count because all type information is stripped during runtime What's the point of keeping this information around at runtime if you do all
by kchamplewski 7y ago
> TypeScript doesn't count because all type information is stripped during runtime
What's the point of keeping this information around at runtime if you do all your type checks at compile time?
Based on this categorisation, Haskell for example isn't a strongly typed language, and yet Haskell's type checking is one of its biggest selling points, so this doesn't seem quite right.
- eropple 7y agoIn practice, you don’t do all your type juggling at compile-time in even moderately complex libraries or applications. So TypeScript could certainly use better RTTI, I think. design:type metadata is insufficient.
- overgard 7y agoReflection is really useful. Right now the only way to differentiate types at runtime is testing for the existence of a key, which is kinda hacky.
- nicoburns 7y ago> What's the point of keeping this information around at runtime if you do all your type checks at compile time? It forces you to write input validation code that stays in sync with your types. Otherwise bad input can invalidate all your type guarantees.