|
|
|
|
|
by recursive
697 days ago
|
|
Yes it throws in typescript. Typescript isn't the the language chasing soundness at any cost.
This just illustrates the futility of chasing soundness. Soundness is good as long as the type-checking benefit is worth the cost of the constraints in the language.
If the poster child for soundness isn't able to account for this very simple and common scenario, then nothing will actually be able to deliever full soundness. It's just a question of how far down the spectrum you're willing to go. Pure js is too unsound for my taste. Haskell is too constrained for my taste.
You might come to a different conclusion, but for me, typescript is a good balance. |
|
Put another way, SML is all the best parts of TS, but with more soundness and none of the worst parts of TS and non of the many TS edge cases baked into the language because they keep squashing symptoms of unsoundness or adding weird JS edge cases that you shouldn't be doing anyway.