3 ms·
> You can't use the types in runtime so all that effort you put into the types doesn't actually translate when you want to use the type system to full effect.
by nyssos 3y ago
> You can't use the types in runtime so all that effort you put into the types doesn't actually translate when you want to use the type system to full effect.
This isn't really the problem: runtime types would solve the issue, but they're a sledgehammer with all sorts of nasty effects elsewhere. Languages with far stronger type systems than F# still have type erasure: it's actually fairly unusual in that regard.
The core weakness of TS (aside from the fact that its "type" system isn't actually sound) is that it doesn't have type-directed emit: you can't automatically generate safe parsers, for instance, because you can't generate anything. Except enums: why those got a pass is beyond me.