- Yeah, static analysis does have some actual, real advantages. But TypeScript doesn’t really go all the way here, either. Lots of people use
<any>to bridge with libraries, or just let libraries remain weird untyped strange lands. In which case, you’re in the same boat even using TypeScript.
- Static analysis also has some actual, real disadvantages. For example, more expressive dependent types are trivial to express with runtime type checkers (stuff like predicate literals, regular expressions for advanced string subtypes, etc… we have the full expressive power of the JS language to validate types). Giving that much expressive power to a static type system can make type correctness unprovable at compile time.