logoalt Hacker News

ecshaferyesterday at 9:01 PM9 repliesview on HN

What is wrong with the Python code base that makes this so much harder to implement than seemingly all other code bases? Ruby, PHP, JS. They all seemed to add JITs in significantly less time. A Python JIT has been asked for for like 2 decades at this point.


Replies

0cf8612b2e1eyesterday at 9:32 PM

The Python C api leaks its guts. Too much of the internal representation was made available for extensions and now basically any change would be guaranteed to break backwards compatibility with something.

show 2 replies
hardwaregeekyesterday at 9:44 PM

For what it’s worth Ruby’s JIT took several different implementations, definitely struggled with Rails compatibility and literally used some people’s PhD research. It wasn’t a trivial affair

fleetfoxtoday at 9:51 AM

I can't really talk about Ruby. But PHP is much more static and surface of things you have to care about at runtime is like magnitude smaller and there already was opache as a starting point. And speaking of something like JIT in V8 is of the most sophisticated and complicated ever built. There hasn't been near enough man hours and funding to cpython to make it fair comparison

stmwyesterday at 9:12 PM

Some languages are much harder to compile well to machine code. Some big factors (for any languages) are things like: lack of static types and high "type uncertainty", other dynamic language features, established inefficient extension interfaces that have to be maintained, unusual threading models...

show 3 replies
fridderyesterday at 10:13 PM

For better or for worse they have been very consistent throughout the years that they don't want want to degrade existing performance. It is why the GIL existed for so long

bawolffyesterday at 10:09 PM

I thought php hasn't shipped jit yet (as in its behind a disabled by default config)

show 1 reply
brokencodeyesterday at 9:28 PM

Are you forgetting about PyPy, which has existed for almost 2 decades at this point?

show 1 reply
wat10000yesterday at 9:13 PM

PHP and JS had huge tech companies pouring resources into making them fast.

g947oyesterday at 9:42 PM

Money.