Top
Best
New

Posted by f311a 1 day ago

Python's experimental JIT to be removed(lwn.net)
515 points | 282 commentspage 6
claudiojulio 22 hours ago|
It doesn’t matter. Just write it in Rust. AI will make Python less relevant in the future.
avadodin 2 hours ago|
Other than the trolling, you couldn't be more wrong.

AI literally turned Python from this silly esolang that PhDs seem to love into the Lingua Franca of Computing.

All LLM tools are built Python-first and all LLMs are trained Python-first.

If there is anything you can believe in beyond gravity and taxes is that an LLM's first tokens on a new shell will be py thon 3.

mhh__ 23 hours ago||
It seems like such a failing and waste of human life that we spend all this time waiting around for python when the JS engines are so cutting edge.
mhh__ 18 hours ago||
Why is this controversial? We spend hours waiting for python code when it could be much faster if it was treated like a serious programming language
mahboi 11 hours ago||
I think it's mainly because of how easy C interop is in Python. Same reason no other interpreter replaced CPython.
neya 2 hours ago||
> Same reason no other interpreter replaced CPython.

Source?

faangguyindia 22 hours ago||
I just use Go and Rust for everything; most of my mobile apps are in Flutter. I don't see any point in using anything else.

for me it's over for python

alerighi 21 hours ago|
I would not like a JIT to be embedded in python for one reason. The sole reason why Python didn't have all the security related bugs of other languages (just think about all the exploits in JS engines, as well as the recent PHP vulnerabilities) is sorely because it's an interpreted language, that is python is compiled in a bytecode that runs in a VM.

Under these premises is very difficult that something not implemented correctly is really exploitable, and moreover it's simple to verify the security of the whole thing.

Opening a JIT, that would mean mapping memory pages as RWX, would open the door to all soft of exploits that now are not really possible.

xx_ns 21 hours ago||
While I don't disagree with you in principle, the context for JS JIT vulns and potential Python JIT vulns is pretty different and worth taking into consideration.

For JS, your machine running untrusted JS code is the intended use case. In this scenario the JS is sandboxed in whatever JS engine (V8 etc) and does not have access to "dangerous" methods, and the main use case for a JIT vuln is to escape this sandbox to execute code on the host. This applies to regular internet browsing (and visiting potentially malicious sites) and also, e.g., using the built-in browser in a locked down device (such as game consoles) to gain arbitrary code execution.

For Python, this security boundary doesn't exist. I can't really think of a scenario where you would be running potentially malicious Python code in CPython that would need a JIT vuln to escape whatever sandbox it is in instead of, say, calling the functions in Python directly (or using the C FFI to do whatever). I'm sure that in some niche use cases, this scenario might exist, but to me, it seems like the potential attack surface is fairly minimal.

EDIT: Also, I'm pretty sure that Python's copy-and-patch JIT writes code to a writable mapping and then mprotects it to W^X? I don't think it leaves RWX pages lying around at all.

stickfigure 21 hours ago|||
Who is running sandboxed untrusted Python code?

JS has a completely different threat model. And PHP has just been a basketcase from inception.

CGamesPlay 21 hours ago|||
> just think about all the exploits in JS engines, as well as the recent PHP vulnerabilities

Can you name some of these JS engine vulnerabilities? And the PHP one had nothing to do with JIT.

futuraperdita 21 hours ago||
Not OP, but JS engine JIT bugs are pretty common.

https://phrack.org/issues/70/exploiting-logic-bugs-in-javasc...

https://www.sentinelone.com/vulnerability-database/cve-2026-...

https://projectzero.google/2020/09/jitsploitation-one.html

https://www.zerodayinitiative.com/blog/2021/12/6/two-birds-w...

incrudible 15 hours ago|||
This argument would be more convincing if, due to performance reasons, most Python code didn't use C extensions, where exploits are highly prevalent.
mohamedkoubaa 20 hours ago||
I would want a python implementation with a JIT and the ability to choose JIT or no-JIT when defining a python environment. And I want all my libraries to work either way.

I'll get what I want eventually but I might be retired by then.