Re:How JavaScript engines achieve great performance
by exdsq on Wednesday November 24, 2021 @09:25PM
(#29337624)
I think you're overthinking this. TypeScript definitely helps catch issues - there have been large migrations to TS that were well received by engineers and project managers alike. Yes there are issues in the type system but you can find them in any language. Haskell has very strong claims but then you come across 1/0 != 1`div`0
[ Parent
| on HN ]
Re:How JavaScript engines achieve great performance
by ragnese on Wednesday November 24, 2021 @09:48PM
(#29337732)
Your Haskell example doesn't actually violate its own type system, though. 1/0 is Fractional or Double or whatever, so it gives Infinity. 1`div`0 is Integer and Infinity is not an Integer, so it explodes, instead.
Definitely confusing. Perhaps poorly designed. But it's not type-theoretically incorrect. I'm complaining about TypeScript being literally incorrect in its handling of types. Not "strange" or "weird" or "surprising", but incorrect.