Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Full Handbook Page on Soundness #1059

Open
karlhorky opened this issue Jul 4, 2019 · 2 comments
Open

Full Handbook Page on Soundness #1059

karlhorky opened this issue Jul 4, 2019 · 2 comments

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Jul 4, 2019

From my tweet, where I suggested that it would be beneficial to have a Handbook page on Soundness:

https://twitter.com/karlhorky/status/1146687994142842880

My initial top-of-my-head suggestions in the tweet were to include at least the following information:

  1. What is soundness / type safety and why is it important?
  2. Maybe: what is completeness?
  3. An overview of the general state of soundness in TypeScript (maybe from Type Compatibility)
  4. What common structures or patterns can be expected to be unsound

Happy to add to the list, if anyone thinks of anything!


Unsound Behaviors

For 2. above, starting a list of unsound behaviors here:

No excess property checks in object types with spread (Playground)

Incorrect definition of spread and Object.assign (Playground)

Trade-offs in Control Flow Analysis


This has been prompted by the high-quality criticisms as of late on Twitter by @sebmck:

This has been going on since ~ June 18:


Articles / discussion on the topic:

@orta
Copy link
Contributor

orta commented Aug 30, 2019

I've included an example on soundness in microsoft/TypeScript-Website#43 which I think is probably enough, it doesn't aim to be comprehensive but it explains what soundness is, why TS isn't sound, provides examples and then links to the two main places where it is documented.

@karlhorky
Copy link
Contributor Author

Ah cool, thanks @orta!

I think I would still suggest documenting and publicizing this more openly than an example - feels like having this in the top-level handbook documentation would help clear up a lot of things for beginners and experienced developers alike.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants