Closed
Description
In various issues, I've seen a tendency to treat some of TypeScript's type checking limitations (see #5786, #7933, #9765, #3410 (comment)) closed as By Design or Design Limitation. (There are more, but I think other folks here know more about them than I do.)
A few arguments I want to posit about this:
- TypeScript is better than nothing/straight JS (I think most here would agree on this)
- TypeScript's mission is to layer type-checking on top of JavaScript coding (taking this from TS's adherence to minimalism on top of ECMAScript, aside from types)
- Its weaknesses can become worse than nothing, with time. Reasoning:
- Existence of TypeScript reduces community drive to implement another type-checked JS-based language competitor (since one already exists)
- Anchors the community to both the strengths and the limitations of the TS codebase, due to the above
- TypeScript type fundamentals only become harder to change with time (more language support = more legacy code); I personally believe there is a cliff here we may have already passed, but I really hope we haven't
What I'm interested in knowing is whether the TypeScript community/team consider type-checking unsoundness as something that should be fixed, given the opportunity. I can see a few different ways to handle these issues, and I'm very interested to hear from the TypeScript team which options they would lean towards (or none of the below):
- Keep long-lived tickets open for such limitations, with the goal of implementing a fix
- Pros:
- Collect use cases/examples in one place
- Provide a meter to community pressure to implement a fix
- Tickets can collect discussion on design/impl proposals, pros/cons/lessons learned of previous attempts, etc.
- Active tickets attract attention, and motivating developers to spend their free time on it
- Cons:
- Old ticket "noise"
- Tickets grow stale (lack of interest?)
- Easy for a few folks to derail one ticket's discussion
- Splintering of codebase (not sure when next-major-release branches are cut, but this could become difficult to maintain if the PRs come at the wrong time)
- Pros:
- Add a compiler flag to warn on known type unsoundness
- Pros:
- Probably easiest fix/patch on current code
- Smooths over a chunk of current developer needs (run the strict build occasionally, review warnings to make sure benign)
- Cons:
- Risks stagnation (solving some developers' needs also proportionally reduces the pressure for a proper fix)
- Not discoverable (warnings wouldn't be on by default, since they'd almost certainly be filled with false positive noise)
- Pros:
- Don't do anything, treat current design as dogma (but document unsoundness in one place)
- Pros:
- Easiest
- Aligns with mission? (hopefully not)
- At least provides visibility in one place (i.e. don't-do-this list)
- Cons:
- Stagnation
- Subverts mission? (maybe)
- Troubling future regarding treatment of "legacy" style bugs
- Pros:
- Really don't do anything
- Pros:
- Easiester
- Cons:
- Really?
- Pros: