by nerdponx · 5y ago · 0 comments
There are also Jython and IronPython, although I don't know how successful/popular or actively-maintained those implementations are.
Someone recently pointed out on IRC that Python is transitioning away from a language with "one implementation, and the implementation is the spec" to "one preferred implementation with an informal spec, but many alternative implementations".
Now that PyPy v7.3.7 seems to support 3.8 without any issues that I've encountered, I'd strongly consider evaluating it for use in production code. It might be interesting to run some async webserver + data processing benchmarks or something across the various implementations. Maybe a good benchmark would be measuring total throughput on something like "process/sanitize some user-provided text file, then serve a prediction from a PyTorch model".
I don't think this is a new thing at all. When I first heard of Python a decade and a half ago, the "pitch" in the official docs back then was that "Python" was a programming language while "CPython" was the reference implementation of it. And the docs were (and still are) quite careful to point out which things are implementation details of CPython and are not to be relied upon if portability to other implementations or future versions of CPython are desirable features.
I don't know what you mean about an "informal spec", the the full formal specification of Python (the language) is here: https://docs.python.org/3/reference/index.html
I think GP meant "informal" in the sense that python wasn't originally meant to be a multi-implementation language. Though the oldest alternative implementation goes back to 1997, alternatives were always, until relativel recently, second class. I don't have the tools or the time to quantify what I mean by "recently" or "second class", but I hope you know what I mean.
The single biggest marker of being "second class" that I do know of is how the new features always gets introduced first by Cpython, then every other implementation plays catch up. This is unheard of in true multi-implementation languages, what I have in mind is C, C++, Java and Javascript. I'm sure there are plenty more, but those just, off the top of my head, are the most prominent languages whose features are introduced first in completely implementation-agnostic way, then all implementations start racing to get it complete.
I don't mean to say that Cpython maintainers just wake up in the morning and decide to add new syntax or semantics to the language, PEP documents are quite formal and implementation-agnostic, but I always had the impression it's something by Cpython devs for Cpython devs, and supporting that is how a Cpython implementation always appear first and other implementations lag behind by a varying amounts.
A significant performance improvement in python would benefit many ds related tasks.
Doesn't matter how fast a GPU you have; Python and the GIL is the bottleneck.
Fortunately, with a tool like DVC or even Make, you usually don't have to (or want to) put that code in the same script as the actual machine learning part. So you can theoretically run the former with PyPy and the latter with CPython, if you really need to maximize both.
But my post was more oriented towards non-data-science uses of Python, like writing an API server or a web crawler or a TUI application. I think the "serve a prediction from a PyTorch model" part threw off the conversation a bit!
It's been "transitioning" for as long as it existed. The alternative forks all eventually die.
Heck, I probably should have mentioned Stackless too, which apparently is still being actively developed.
Nuitka probably is worth mentioning along these lines too.