Python JIT project was asked to pause development
Posted by kbumsik 3 days ago
Comments
Comment by mwkaufma 3 days ago
lol
>> For example, rather than proposing one single concrete JIT implementation, it may make more sense for the PEP to describe a JIT infrastructure that can support multiple implementation strategies.
poison-pill requirement
>> We are setting a window of six months for a PEP to be submitted and resolved. If no such PEP is accepted within that window, the JIT code must be removed from the main branch
so it's going to be removed from the main branch
Comment by sidewndr46 3 days ago
Comment by scott_w 3 days ago
Comment by pjmlp 3 days ago
Python JIT history is full of drama, and no, Smalltalk, Common Lisp, Interlisp-D, SELF are just as dynamic if not more.
Comment by stevefan1999 3 days ago
Comment by ck45 2 days ago
Comment by scott_w 3 days ago
Comment by pjmlp 3 days ago
I haven't said otherwise.
Comment by scott_w 3 days ago
Comment by pjmlp 2 days ago
> So it will join PyPy and GraalPy in the corner.
If you cannot understand what that means, I am not a English professor.
Comment by scott_w 2 days ago
Comment by pjmlp 2 days ago
Comment by scott_w 2 days ago
Not even remotely the same context.
Comment by pjmlp 2 days ago
We have been here several times, versus the other dynamic languages, and it has nothing to do with the usual excuse how dynamic Python happens to be.
Comment by scott_w 2 days ago
What’s your position? That we should allow an extremely complex system into Python with:
- No clear design goal?
- No maintenance plan?
- No discussion with the steering committee?
PyPy and Jython, and others are not built by the Python team and there has never been a suggestion that any of these systems would be part of CPython.
So again, I still don’t see how different implementations of Python are relevant to the discussion about CPython.
Comment by pjmlp 2 days ago
Comment by onlyrealcuzzo 3 days ago
Comment by throwaway81523 3 days ago
Comment by pjmlp 2 days ago
All of them support changing anything at anytime, killing all JIT assumptions, and forcing it to redo the world.
Stop execution, land into the debugger, change whatever code you feel like during the debugging session and then redo last statement, continuing execution.
There are also ways to do this on fly, without necessarily using the debugger.
Comment by dataflow 3 days ago
Er, doesn't that depend on how leaky the abstraction is? How often have you seen a JITted language be unable to swap in a new JITter due to some sort of unintended coupling?
Comment by scott_w 2 days ago
Comment by dataflow 2 days ago
Comment by scott_w 1 day ago
What I don't understand is "what is your position?" Is is that writing a PEP is unnecessary because adding a JIT to Python could trivially meet the goals you state?
My position is simple: adding a JIT is a major change to the language, so of course it should undergo a PEP and answer the major questions that the steering committee put forward. If you think those questions are trivial, then that's ok. Just answer them in the PEP.
> And if it has to be approved by someone who responds like this, it clearly wouldn't be fun either.
I really don't see why you'd think I would be representative of the steering committee's opinions or attitudes. Do I share a name with one of the members?
Comment by LtWorf 3 days ago
What forever are you talking about? Python removes stuff every single release.
Comment by scott_w 2 days ago
Comment by tasuki 2 days ago
Comment by NekkoDroid 2 days ago
Comment by LtWorf 2 days ago
No need to do the annoying if x is None.
Comment by tasuki 2 days ago
Comment by LtWorf 2 days ago
If you declare a function inside a for loop with the default argument set to a list, it will be re-declared at every iteration of the loop and the list of the default argument will be a new instance every time.
Comment by tasuki 9 hours ago
I understand as much.
> It's not really a design choice.
That explains it then. Pretty damning though, no?
Comment by NekkoDroid 8 hours ago
My assumption just makes sense when all the function really gets is "a list of positional arguments and a dict of keyword arguments" (ala `*args, **kwargs`) that is "deconstructed" to the named variables on the function side. Then the function never gets the default value passed and fills it in before executing the body. Therefore it needs some value to assign and that value is determined when parsing the function definition.
So effectively I want to say that I think instead of the default value being passed at the call site (which is how C++ for example does it by inserting the expression inplace of a specified value) it is filled in by the function before executing the body.
In the end this is just a guess, but that is my working hypothesis.
Comment by hanzeweiasa 3 days ago
Comment by Qem 3 days ago
I didn't notice the current PEP was a provisional one. Hope the new one gets approved. The experimental JIT was reported to finally breaking even and surpassing the default interpreter just a couple of months ago[1].
[1] https://fidget-spinner.github.io/posts/jit-on-track.html
Comment by ksec 3 days ago
Thank You. As someone who don't follow python closely I thought their JIT would be similar to what Ruby has.
Not that Ruby YJIT or ZJIT is anywhere close to what JVM provides, but in this case it seems to be quite far ahead of Python.
Which is surprising given how many major companies are using Python. May be because those using Python are not using it as critical part of work unlike Shopify and Stripe which is their core language?
Comment by bob001 3 days ago
Comment by thatguysaguy 3 days ago
Comment by bob001 2 days ago
Comment by jbvlkt 3 days ago
Comment by IshKebab 3 days ago
Comment by Qem 3 days ago
Comment by IshKebab 3 days ago
Of course the counterargument is that they'll improve it and maybe in future it will be 100% faster... But that seems pretty dubious given the progress so far.
Comment by germandiago 2 days ago
It is nice to have the speed, always. But in Python, it would be a mistake to do it at the expense of flexibility. Same for typing: it is great to have it. I use it. But Python should be dynamic and the rest and extension that does not compromise everything else.
If a JIT can make Python 2 or 3x faster, or even 10x for some workloads, that is nice. But the language itself should support same idioms, reflection, dynamic typing, etc at the same level.
Comment by germandiago 1 day ago
Comment by mike_hock 3 days ago
Comment by oliwarner 3 days ago
To leave their experimental phase they have to define some goals to meet and that requires making some architectural choices that still aren't decided.
Comment by bob001 3 days ago
Comment by mellosouls 3 days ago
Development hasn't been paused (with negative implications).
It's now considered significant enough that they've requested feature freeze in CPython main until governance/process questions are settled.
Comment by wavemode 3 days ago
Comment by necovek 2 days ago
If it is, is it not documented somewhere? Maybe as a formal PEP?
If it is not and it is still in heavy experimentation phase (which is fine), it should not be part of the mainline CPython no matter how much more effort it is for the team to experiment with.
Comment by baq 3 days ago
Comment by folkrav 3 days ago
Comment by simonw 3 days ago
Comment by mindcrime 3 days ago
And yet, I have a hunch it will piss off a lot of people nonetheless and lead to much outrage and wailing and gnashing of teeth. Hopefully it all works out in the long run.
Comment by 12398761 3 days ago
They should perhaps have kept it in a separate branch back then, but now is the next best time.
CPython's selling point was that it is simple, fast enough with C extensions and the code was accessible. Complicating the code base for occasional 50% speedups (and regressions ...) just isn't worth it. There are so many other languages that fill that need.
Now, I hope that the PEP does not overpromise again and is accepted because of Instagram pressure. Instagram can keep its own JIT fork or switch to PHP, Go or whatever.
Comment by ameliaquining 3 days ago
Comment by ptx 3 days ago
Comment by kelvinjps10 3 days ago
Comment by Qem 3 days ago
To be fair, the apparent lack of progress of the JIT before was in part due to the same team improving the base interpreter by 40-50% between 3.10 and 3.14. The JIT implementation was pursuing a moving target. It was not some static milestone. Kudos for them.
Comment by oefrha 3 days ago
Comment by ospider 3 days ago
As for performance, Python 3.x was not even as fast as Python 2.x in the beginning, but with the correct mindset, it's eventually faster.
Comment by germandiago 2 days ago
Comment by dist-epoch 3 days ago
By now it should be clear to anybody working on Python JIT that the probability of failure is 90%.
The future is probably rewriting performance critical Python code in Rust instead of trying to fix Python.
Or maybe a future LLM could add a JIT to Python in an effort-run.
Comment by adsharma 2 days ago
This will require minor tweaks to the language and perhaps a forked interpreter (a forked parser already exists).
Then you solve the two language problem with a combination of probabilistic and deterministic translation.
Comment by varispeed 2 days ago
I hope they are proud of themselves.
JIT should be a top priority given popularity of Python. It should significantly reduce carbon footprint of Python driven applications.
Comment by jhayward 3 days ago
If I were a contributor I would read such language as saying "we have no respect for you or your intelligence, so we'll just straight up gaslight you and expect you to accept it."
The dictum can't be read literally - it has to be read like the manipulative, narcissist-speak that it is. And what it's telling you is - get out.
Comment by _old_dude_ 3 days ago
> For example, rather than proposing one single concrete JIT implementation,
> it may make more sense for the PEP to describe a JIT infrastructure that
> can support multiple implementation strategies.
> Since many different and promising JIT tracing approaches continue to be proposed,
> we believe the infrastructure should make it easy to experiment with and evaluate
> those approaches within CPython rather than be highly coupled with a single strategy.
Allowing multiple strategies is far harder and as far as I know, JIT tracing is still unproven.Comment by zem 3 days ago
Comment by Retr0id 3 days ago
Comment by bob001 3 days ago
Comment by KaiserPro 3 days ago
out of curiosity, why not?
I mean it seems like they want to get a full spec of what JIT should look like in main? given the faff that hapened with the GC removal, I can sort see why they'd want to do this properly. Especially now that it seems like its practical.
Comment by simonw 3 days ago
That's a very strong claim. I'm not seeing that at all. What causes you to interpret it that way?
Comment by mike_hearn 3 days ago
Comment by Fraterkes 3 days ago
Comment by knollimar 3 days ago
Comment by 12_throw_away 3 days ago
Comment by sitkack 3 days ago
It would be nice if cpython opened up a bit, pluggable GC and JIT would go along way towards reducing this manufactured drama.
It wasn't cool to see PyPy or Stackless getting sidelined.
Comment by woodruffw 3 days ago
> pluggable GC and JIT would go along way
One of the points mentioned in the linked discussion is explicitly about ensuring that the JIT design enables multiple implementations.
Comment by sitkack 3 days ago
The flippant attitude of cpythons wrt the standard library is also unfortunate.
Please with your substantive comment comment.
Comment by woodruffw 3 days ago
> Please with your substantive comment comment.
I think binning things as drama isn't substantive, particularly when noting about the linked conversation seems dramatic. I also think they're actually talking about the thing you want (pluggable JIT), so the objection seems incongruous.
Comment by anticorporate 3 days ago
I assumed Python 2 was pretty much ubiquitous and that the world wasn't adopting Python 3 very quickly for a long time, but I do wonder if the applications I was working with a decade and a half ago (ArcGIS, Blender, Civ4, lots of Red Hat system tools, etc.) biased that viewpoint.
Comment by cdavid 2 days ago
Data science, and then ofc DL being done through python just when python 3 was kinda usable (around 3.3/3.4) was a struck of luck timing-wise.
Comment by questiuner 3 days ago
Comment by kzrdude 3 days ago
Comment by JulianWasTaken 3 days ago
I assume you might mean to ask "why wasn't PyPy adopted in some formal way into CPython" rather than a separate project, for which the answer is at least partially likely to be because it's a completely separate implementation.
Comment by anon-3988 1 day ago
Comment by IshKebab 3 days ago
Comment by andrewmcwatters 3 days ago
Comment by OutOfHere 3 days ago
Comment by bob001 3 days ago
Comment by rurban 2 days ago
Comment by simonw 3 days ago
Comment by kzrdude 3 days ago
Comment by 12_throw_away 3 days ago
Comment by nmstoker 3 days ago
Comment by elpocko 3 days ago
Comment by nmstoker 3 days ago
At the time I posted it, both were pretty lacking in attention, so it made sense to direct to the earlier of the two.
Comment by elpocko 3 days ago
I did click on your link, it was a waste of time and that wasn't very nice.