News for hackers. Stuff that matters.
Re:I Want a New Duck (2020) by glyph on Thursday March 18, 2021 @04:01PM (#26506939)
The post isn't about performance, and is aimed at people using Python for whatever reason, so, sure, retrofit away.

That said, if you care about the performance improvements that typing can give you with Mypy, you might want to look here:

https://github.com/mypyc/mypyc-benchmark-results/blob/master...

It won't be going toe to toe with Rust any time soon, but a 4x to 17x speedup is nothing to sneeze at.

Re:I Want a New Duck (2020) by throwaway894345 on Thursday March 18, 2021 @04:11PM (#26507047)
That's cool if there's any indication that this could actually be used in production. Namely, what is the compatibility with the ecosystem. The history of Python could be aptly characterized as a series of big problems -> tools promising miraculous solutions -> tools utterly failing to deliver on those solutions because they failed to consider some important part of the ecosystem. We need more than a benchmark graph to suggest that this is a panacea to Python's longstanding performance problems.
Re:I Want a New Duck (2020) by glyph on Thursday March 18, 2021 @07:48PM (#26508821)
Mypy itself uses this extensively; it was developed because typechecking itself was getting too slow. So it’s seen some practical real-world use. It’s not a panacea (heck, it’s barely documented) but it’s an appealing option if you have some clear hotspot in Python that you need to optimize.
Re:I Want a New Duck (2020) by slaymaker1907 on Thursday March 18, 2021 @05:52PM (#26507954)
There is a very similar tool called Cython that is used by scikitlearn. Coincidentally Cython also solves a lot of python 2/3 problems since it compiles for both.