3 ms·
> Python is not an option for me, since I like static typing. Have you checked out mypy recently (past few years)? With all the strict flags, it's pretty damn
by kortex 5y ago
> Python is not an option for me, since I like static typing.
Have you checked out mypy recently (past few years)? With all the strict flags, it's pretty damn hard to get anything but bulletproof static typed code to pass. The only major downside is it lacks higher kinded types at the moment, and there is a PR in the works to add that. But it has all of the other accoutrements you'd expect from a modern type system: generics, structural subtyping, co/contravariance.
- staticassertion 5y agoThere are way more downsides than that. 1. No recursive types, so you can't express a lot of basic things like a "Json" type. This ends up coming up a lot more than you might imagine. 2. Not great support for every pep ie: Protocol 3. Generics are extremely confusing in mypy. Generic classes suffer from the lack of recursive types I'd mentioned as well. 4. Implicit 'Any' everywhere unless you use the strictest settings, which I don't believe anyone does on real code because of the above issues. I've never once managed to get a real codebase to typecheck with mypy. Honestly mypy works as a somewhat fancy linter, not as a type checker.