The Pyston team posts releases and plans for Pyston, a faster Python implementation that began at Dropbox and later joined Anaconda.
HN commenters link it as the Dropbox Python JIT project, with several describing it as stalled or failed, and one citing it on lack of funding.
No matter how hard you're wishing it to be true, does not make it so. PyPy will "have" to catch up? in the name of what? PyPy is but one of the many projects that are still thriving in the 2.x ecosystem, there's even a competitor to PyPy that was launched 2 years ago that is also a 2.x exclusive: Pyston.
https://blog.pyston.org
Yes, a very new implementation project that happens to focus on 2.7.
Python 2 gets all the better runtimes. Long after the end of life of the official CPython 2.7, we will still be running 2.x programs, and doing it on much better runtimes than CPython.
We've been hearing the same tirades of Python 3's future over and over again by its partisans ever since its release in 2008. 8 years have passed since then. 8 years will pass and Python 3 will still have nothing but a minority of vocal open source users. Python will be treated as a legacy language the way COBOL and BASIC are treated before py3 starts picking up any steam. That's kinda what some companies are already doing, like Dropbox. Switching to Go here and there, while keeping the maintenance of their very large 2.7 python codebase with absolutely no intention whatsoever of moving that behemoth to 3.x. Why bother? they could write new software features, fix bugs and so on instead of waste time on porting. Why waste so much time on porting when it brings so little benefits? Programming is ultimately about problem solving. Porting to python 3 doesn't make my software better. It's certainly not…
https://blog.pyston.org/
You can look at the last release of Pyston for why companies are not funding this work. They're just moving to other languages.
Consider that Dropbox, Google, and Instragram likely spend much more than 1M on optimizing/ improving Python, just to have it still be a relatively slow language.
At some point it becomes way cheaper to just move to other languages that don't require that constant level of effort. Think about how much time and money is spent on things like:
* Adding types to Python
* Improving performance
when you could just move performance critical code to Go/ Rust as Dropbox has done, for a fraction of the cost, with far less maintenance burden.
"Make Python faster" is just a losing game imo. It is fundamentally never going to be as fast as other languages, it's far too dynamic (and that's a huge appeal of the language). Just look at the optimizations done here - moving `str` to local scope to avoid a global lookup? And can you even avoid that? Not without changing semantics - what if I want to change `str` globally?
Still, I was surprised by some of the sorta nutty wins that were achieved here. There's clearly some perf left on the table, and I'm not an expert on interpreters, it just seems really hard to build a semantically equivalent Python ("I can change global functions from a background thread") that can automatically optimize these things.
I'm not sure if it's an exact fit, but dropbox used to have pyston: https://github.com/dropbox/pyston
The blog posts by Kevin Modzelewski went into the internals: https://blog.pyston.org/
Also by the same person, a good article on Python's performance: http://blog.kevmod.com/2016/07/why-is-python-slow/
As a side comment: On the subject of type inference, I really come to like python's type hints. I don't use mypy itself yet, but already had a habit of adding types in docstrings, and like it when I can add a clue that a signature/return is dealing with a something that's not a basic type.
There are some nice little things out there for advanced typing, being added now and then:
- TypedDict and Literal: https://github.com/python/typing/blob/master/typing_extensions/README.rst (TypedDict was accepted in PEP 589[1])
- NamedTuple had variable annotation added in Python 3.6: https://www.python.org/dev/peps/pep-0526/
I wonder if typings are added to a codebase, we could give LLVM one more shot. It'd be pretty crazy to build able to build a large graphql server and build it into a statically linked binary like golang.
[1] https://www.python.org/dev/peps/pep-0589/
Pyston originally started as an internal project at Dropbox and they had a couple of super interesting blogposts where they detailed their approach and findings[0]. After a a year or two, the project got axed, but the devs kept working on it and then released it on their own (I don't remember the details, but evidently the chosen license for the project allowed that).
Last year (I think it was last year, but can't tell if that was 2020 or 2019) they released it on their own, thinking of a commercial model. Now they have switched to OSS+services, which is interesting because it'llopen up more people using Pyston.
I tihnk this is interesting in its own right, but yesterday we got Facebook announcing Cinder[1] -- which is unsupported to outsiders, but significantly faster than Pyston. According to Facebook, they intend for parts of Cinder to be upstreamed (and have already upstreamed a few, apparently) to CPython. So again, and sorry for using such a vague word, it'll be interesting to see how all these things play out in time.
[0] https://blog.pyston.org/2014/09/
[1] https://github.com/facebookincubator/cinder
Python is, despite its simple appearance, a much more complex language than JavaScript. A V8 equivalent for Python is certainly possible, but would require even more work than went into creating V8 itself - who would be motivated to spend that much effort on Python?
Dropbox? They seem to be the company driving Python nowadays, but gave up trying to speed up Python in favour of writing "performance-sensitive code in other languages" [1].
PyPy uses a meta-tracing approach in an attempt to reduce the amount of work required. Its speed is impressive, but I'm sure meta-tracing leaves some performance on the table.
Another way to reduce the amount of work required would be to support only a subset of the language - for example, a V8 equivalent for MicroPython rather than for full Python. I'm sure this could be made very fast, but it would have very poor compatibility with existing Python code, so what would be the point?
[1] https://blog.pyston.org/
other alternative : PYSTON "Pyston is a faster and highly-compatible implementation of the Python programming language."
"Our speedup on ARM (30% on a Graviton EC2 instance) is comparable to our speedup for x86 (34% on an Intel i7-6700)."
https://blog.pyston.org/2022/04/01/pyston-v2-3-3-arm-support/
2021.aug.30 : "Pyston Team Joins Anaconda to Expand Open-Source Project Development" https://www.anaconda.com/blog/pyston-team-joins-anaconda
Roadmap: https://blog.pyston.org/2021/10/26/pyston-roadmap/
Github: https://github.com/pyston/pyston