Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



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...


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.



"compiled Mypy with Nim-like speed" is Nim, essentially.


I think cython is already using type annotations to compile python code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: