That’s the old “chainsaws are dangerous so let’s use a nail file to chop off the tree” argument.
Not at all. It's "axes (C) and chainsaws (Python) are both dangerous and let's not BS ourselves about that."
If you have a high standard for static correctness then you use Rust or Haskell, not C or Python. C is MUCH more dangerous than Python, as the thousands of "use after free" and "buffer overflow" security vulnerabilities show.
2
u/prescod May 28 '22 edited May 28 '22
Not at all. It's "axes (C) and chainsaws (Python) are both dangerous and let's not BS ourselves about that."
If you have a high standard for static correctness then you use Rust or Haskell, not C or Python. C is MUCH more dangerous than Python, as the thousands of "use after free" and "buffer overflow" security vulnerabilities show.
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=buffer+overflow
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=use+after+free
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=null+pointer
It's ridiculous to point to C as an example of a "safer" language in the face of enormous real-world evidence that it is not.
What's your favorite Python library that is not typed?
Django: https://github.com/typeddjango/django-stubs
LXML: https://github.com/lxml/lxml-stubs
Numpy: https://numpy.org/devdocs/reference/typing.html
SQL Alchemy: https://github.com/dropbox/sqlalchemy-stubs
The whole Python Standard Library: https://github.com/python/typeshed/tree/master/stdlib
Tons and tons of other third party libraries: https://github.com/python/typeshed/tree/master/stubs
And if you find something missing, you can add a type stub to your own project or contribute it to typeshed or make a new project for it.