top | item 45535498

(no title)

wbolt | 4 months ago

More than 300 comments here and still no convincing answer. Why the community wastes time on trying to make CPython faster when there is pypy which is already much faster? I understand pypy lacks libraries and feature parity with up to date CPython. But… can’t everyone refocus the efforts and just move to pypy to add all the missing bits and then just continue with pypy as the “official python”? Are there any serious technical reasons not to do it?

discuss

order

ActorNightly|4 months ago

> Are there any serious technical reasons not to do it?

Yes.

First is startup time. REPL cycle being fast is a big advantage for development. From a business perspective, dev time is more expensive then compute time by orders of magnitude. Every time you make a change, you have to recompile the program. Meanwhile with regular python, you can literally develop during execution.

Second is compatibility. Numpy and pytorch are ever evolving, and those are written a C extensions.

Third is LLMs. If you really want speed, Gemma27bqat that runs on a single 3090 can translate python codebase into C/C++ pretty easily. No need to have any additional execution layer. My friend at Amazon pretty much writes Java code this way - prototypes a bunch of stuff in Python, and then has an LLM write the java code thats compatible with existing intra-amazon java templates.

procaryote|4 months ago

I really hope I'll never need to touch code written by people who code in python and throws it at a plausible randomiser to get java or C

If you for some reason do this, please keep the python around so I can at least look at whatever the human was aiming at. It's probably also wrong as they picked this workflow, but there's a chance it has something useful

wbolt|4 months ago

Repl I get it. Possibly valid point. Yet I guess same issue are valid to node.js which seems much faster in many cases and still has valid dev experience.

C compatibility / extension compatibility - nope. First, it is an issue of limited resources. Add more devs to pypy team and compatibility bugs gets fixed. Second, aren’t people writing C extensions due to python being slow? Make python fast - as pypy - and for some cases native code won’t be that crucial.

So I don’t see a real issue with pypy that could not be solved by simply moving all the dev efforts from CPython.

So are there political, personal or business issues?

selcuka|4 months ago

> can’t everyone refocus the efforts

You have answered your own question.

Seriously, though. PyPy is 2-3 versions behind CPython (3.11 vs 3.14) and it's not even 100% compatible with 3.11. Libraries such as psycopg and lxml are not fully supported. It's a hard sell.

famouswaffles|4 months ago

Pypy only has a handful of devs. If it had the PSF's official blessing, it wouldn't lag behind CPython so much.

wbolt|4 months ago

But this is exactly my point. The resources pypy has are much smaller. And still for years they managed to follow up being just 2-3 versions behind with features and high on performance.

So why not move all the resources from CPython to close the gap with features faster and replace CPython entirely?

Since this is not happening I expect there to be serious reasons, but I fail to see them. This is what I ask for.

ModernMech|4 months ago

> Are there any serious technical reasons not to do it?

Forget technical reasons, how would you ever do it? It feels like the equivalent of cultural reprogramming "You must stop using your preferred interpreter and halt all your efforts contrary to the one true interpreter". Nah, not going to happen in a free and open source language. Who would have the authority and control to make such a directive?

Yes, there may be technical reasons, but the reason it doesn't happen more than any other is that programming languages are languages spoken by people, and therefore they evolve organically at no one's direction. Even in languages like Python with a strong bent for cultural sameness and a BDFL type direction, they still couldn't control it. Often times, dialects happen for technical reasons, but it's hard to get rid of them on technical grounds.

otabdeveloper4|4 months ago

> pypy which is already much faster

It isn't.

bjoli|4 months ago

For all my applications, going to PyPy was an instant 2x improvement.

Not only that, it is a lot easier to hack on. I might be biased, but the whole implementstion idea of PyPy seems a lot more sane.

MobiusHorizons|4 months ago

I think for pure python performance it is significantly faster at least on all the benchmarks I have seen. That said a lot of what people actually do in python calls into libraries that are written in C++ or C, which I believe has a similar performance (when it works) on pypy.

wbolt|4 months ago

Yes it is.