|
|
|
|
|
by santiagobasulto
18 days ago
|
|
Python is not statically typed, so I’ll leave it out of the conversation cause it doesn’t even qualify. As for Typescript, everything is wrong. Interfaces can’t describe static methods, can’t declare what exceptions a method throws, etc. not even gonna mention type variance because it’d be a waste of time. I used to study a lot type systems in my youth. Correct statically typed languages are not practical (think Scala). Practical languages can’t be correctly typed (think Go or even Java). There’s always a compromise. That’s why project like this one makes me chuckle, the idea of using statically typed languages is to introduce “some” safety and correctness, so trying to go the other extreme makes no sense. |
|
"Python is not statically typed" doesn't really make sense, because if it is possible to build a static type-checker for python, then you can in fact write statically typed programs in Python, whether or not it is dynamic underneath. The same applies to TypeScript. If I have checked all the types in my program statically, I have written a statically typed program, regardless of whether javascript is dynamically typed underneath.
As for this project: I don't think it's useful because the type-checkers that exist for python have type inference. There is no particularly good reason to give every single thing a type annotation because it provides very little value.
In the end, the only question that is relevant for these sort of type-checkers that are built after the fact is really "Do they provide extra safety and value?" and the answer is very clearly a resounding "yes". Your theoretical gripes don't really have any bearing on that.