2 ms·
You make a good point, that theres an inversion of responsibility here. Type systems can infer correctness, test suites have to prove correctness. I'm not sure
by spmurrayzzz 6y ago
You make a good point, that theres an inversion of responsibility here. Type systems can infer correctness, test suites have to prove correctness. I'm not sure this makes the toolchain overhead tradeoff a defacto major win, but its persuasive for sure.
Curious if you could elaborate on why you don't think the TS type system is sound? I'm not familiar with any arguments to this end currently.
- striking 6y agoIt is unsound. One of the most impactful unsoundnesses is when you cast one array type to another compatible but not exactly equivalent type, and then write to the array. In Flow (another type system) you simply can't do that without making the array read-only at type level. In TS, they decided to allow this for ease of use purposes. Just in general, the TS team optimizes for a balance of bug catching and usability. It is a compromise. Flow is a much more advanced type checker that works even harder at inferring types and eliminating bugs at the type level. It's very cool! But its community is much smaller, the tooling isn't nearly as good, and it has some major performance issues. My workplace is migrating away from it in favor of TS, which is good enough without being too slow or incompatible with our tools.