News for hackers. Stuff that matters.
Re:Applying Mypy to real-world projects by gonational on Tuesday February 11, 2020 @08:13PM (#22304773)
I know performance is not an explicit goal of Mypy, but I’ve been curious whether or not this project could lead to something much faster in the future (compiled Mypy with Nim-like speed, something else?). Any thoughts?

Also, does anybody know of any benchmarks of typical programs in Mypy vs cPython?

Re:Applying Mypy to real-world projects by dfee on Tuesday February 11, 2020 @08:21PM (#22304806)
The types are ignored at runtime; they’re annotations. I guess they could still theoretically have some impact, but it should be negligible.

Compiled mypy is a stated potential goal - but outside the scope of this project itself. Read more here: https://mypy.readthedocs.io/en/stable/faq.html#will-static-t...

Re:Applying Mypy to real-world projects by hsaliak on Tuesday February 11, 2020 @08:49PM (#22304994)
There’s an experimental mypyc that can compile typed code to extensions, it’s not complete but it is used in mypy itself if I understand correctly.

More practically, I’ve found that it’s much easier to translate well typed code to cython. It still requires work, and ymmv.

Re:Applying Mypy to real-world projects by anentropic on Wednesday February 12, 2020 @04:52AM (#22307456)
Re:Applying Mypy to real-world projects by nimmer on Wednesday February 19, 2020 @11:33AM (#22367079)
"compiled Mypy with Nim-like speed" is Nim, essentially.
Re:Applying Mypy to real-world projects by hiccuphippo on Wednesday February 12, 2020 @07:01AM (#22308111)
I think cython is already using type annotations to compile python code.