Remix.run Logo
nine_k 4 days ago

This is sadly so; TS's type system is unsound. But so is C#'s, in ways much more egregious that in TS. Despite that, both languages are very usable in practice, and their static checks prevent a very wide range of problems common in languages without a static type system.

If you need bulletproof soundness and JS as the runtime, you have Purescript %)

debugnik 4 days ago | parent [-]

> in ways much more egregious that in TS

Which ways you say? As far as I know: both TS and C# can carry hidden nulls; both made the mistake of covariant arrays, but C# actually type checks accesses at runtime; and the other unsound case I know of in C# involves a runtime type check as well. Meanwhile, TS (and Python) allow fully unchecked casts into the wrong type.

> both languages are very usable in practice

Agreed, but I still consider TS too unsound in trivial cases for the claim I replied to, despite its expressive power. I think this industry is lacking severely when it comes to basic software correctness.