Live data from Hacker News

Python 3.13 Gets a JIT

tonybaloney.github.io

431–440 of 553 posts

Re: Python 3.13 Gets a JIT

#431
post #420

Earlier quoted context omitted.

This is happening mostly because Guido left, right? The take that CPython should be a reference implementation and thus slow always aggravated me (because, see, no other implementation can compete because every package depends on CPython kirks, in such a way that we're now removing the GIL of CPython rather than migrating to Pypy for example)

It's fascinating to me that this process seems to rhyme with that of the path PHP took, with HHVM being built as a second implementation, proving that PHP could be much faster -- and the main project eventually adopting similar approaches. I wonder if that's always likely to happen when talking about languages as big as these are? Can a new implementation of it ever really compete?

similar with vim vs neovim as well

Re: Python 3.13 Gets a JIT

#432
post #364
post #225

Earlier quoted context omitted.

Node.js and Python 3 came out at around the same time. Python had their chance to tell all the "mission critical legacy code" that it was time to make hard changes.

As much as I would have loved to see some more 'extreme' improvements to python, given how the python community reacted to the relatively minor changes that python 3 brought, anything more extreme would very likely have caused a Perl 6 style situation and quite possibly have killed the language.

Part of the issue with 3 is that the changes were so minor that they were just annoying. Like 2/3 now equals 0.66 instead of 0, thanks for the hard-to-find bugs. `print "foo"` no longer works, cause they felt like it. Improvements like str being unicode made more sense but were quite disruptive and could've been avoided too, just add a new type.

What I would've preferred is they leave all that stuff alone, add nice features like async/await that don't break existing things, and make important changes to the runtime and package manager. Python's packaging is so broken that it's almost mandatory to have a Dockerfile nowadays, while in JS that's not an issue

Re: Python 3.13 Gets a JIT

#433
post #200

The last two-ish years have been insane for Python performance. Something clicked with the core team and they obviously made this a serious goal of theirs and the last few years have been incredible to see.

It’s because the total dollars of capitalized software deployed in the world using Python has absolutely exploded from AI stuff. Just like how the total dollars of business conducted on the web was a big driver of JS performance earlier.

When Node.js started really taking off, I was actually a bit worried that Python would become No Longer Best Practice, but now it definitely seems to be still going strong.

Re: Python 3.13 Gets a JIT

#434

Earlier quoted context omitted.

I'd love to see it eat JavaScript and Java for back-end code. But I doubt that's going to ever happen.

I like python but I would never choose it for anything more than trivial on the backend. I want to know what types are being passed around from one middleware function to the next. Yes python has annotations but that’s not enough.

Type annotations are pretty good. I'd like to see a strict mode though, something you import that makes missing annotations anywhere into a fatal error

Re: Python 3.13 Gets a JIT

#435
post #397

Earlier quoted context omitted.

I like python but I would never choose it for anything more than trivial on the backend. I want to know what types are being passed around from one middleware function to the next. Yes python has annotations but that’s not enough.

Just wait until you see what the enterprise Java developers passing around with type Object and encoded XML blobs. Type checking is really useful but it can be defeated in any language if you don’t have a healthy technical culture.

I wish Python would have native JSON schema support to stop this issue.

There's https://pypi.org/project/jsonschema-typed-v2/ but it hasn't been updated in a few years.

Re: Python 3.13 Gets a JIT

#436
post #357

Earlier quoted context omitted.

Python is amazing and shines for Web development. I'd recommend taking a look at https://www.tornadoweb.org/en/stable/index.html . I use this in production on my pet project at https://www.meecal.co/ . Put Nginx in front and you're golden. Definitely take a look, it's come a long way from ten years ago.

I personally like Quart, which is like Flask, but with asyncio. Django is also incredibly popular and has been around forever, so it is very battle-tested.

aiohttp for the win.

I started with cherrypy, then used twisted for years and finally aiohttp made me never look back or search for anything else.

Re: Python 3.13 Gets a JIT

#437
post #111
post #17

Honestly I don't understand the pessimistic view here. I think every release since Microsoft started funding python has increased high single digit best case performance. Rather than focussing on the raw number compare to python 3.5 or so. It's still getting significantly faster. If they keep doing this steady pace they are slowly saving the planet!

When did Microsoft start funding Python? Also, such a shame that it takes sooo long for crucial open source to be funded properly. Kudos to Microsoft for doing it, shame on everyone else for not pitching in sooner. FYI Python was launched 32 years ago, Python 2 was released 24 years ago and Python 3 was released 16 years ago.

To be clear Microsoft isn't directly funding Python, excluding any PyCon sponsorship.

Microsoft hired Guido in late 2020 giving him freedom to choose what project he wanted. Guido decided to go back to core Python development and with approval of Microsoft created a "faster-cpython" project, at this point that project has hired several developers including some core CPython developers. This is all at the discretion of Microsoft, and is not some arms length funding arrangement.

Meta has a somewhat similar situation, they hired Sam Gross (not the cartoonist) to work on a Python non-gil project, and contribute it directly to CPython if they accept it (which they have), and they have publicly committed to support it, which if I remember right was something like funding two engineering years of an experienced CPython internals developer.

Re: Python 3.13 Gets a JIT

#438
post #366

Wasn't CPython supposed to remain very simple in its codebase, with the heavy optimization left for other implementations to tackle? I seem to remember hearing as much a few years back.

The problem is that: * CPython is slow, making extension modules written in C(++) very attractive * The CPython extension API exposes many implementation details * Making use of those implementation details helps those extension modules be even faster This resulted in a situation where the ecosystem is locked-in to those implementation details: CPython can't change many aspects of its own implementation without break…

[deleted]

Re: Python 3.13 Gets a JIT

#439
post #357

Earlier quoted context omitted.

Python is amazing and shines for Web development. I'd recommend taking a look at https://www.tornadoweb.org/en/stable/index.html . I use this in production on my pet project at https://www.meecal.co/ . Put Nginx in front and you're golden. Definitely take a look, it's come a long way from ten years ago.

I personally like Quart, which is like Flask, but with asyncio. Django is also incredibly popular and has been around forever, so it is very battle-tested.

I've been using FastAPI which is made by the same guy as Flask but taking it seriously this time and using asyncio and making space for multithreaded. It's almost a drop-in replacement for Flask.

Re: Python 3.13 Gets a JIT

#440
post #200

The last two-ish years have been insane for Python performance. Something clicked with the core team and they obviously made this a serious goal of theirs and the last few years have been incredible to see.

Microsoft are paying core devs to work on it full time, for one.

Which is strange considering how bad the tooling to use Python on Windows is. There's a few workflows where people have gone down the beaten path before (Conda, etc.), but outside of that you have to just pretend you're on Linux and use the cygwin toolchains and even that doesn't always work so well. Better support on Linux was a top 5 reason for me making the switch to using it full time when I went off to college, and it hasn't changed substantially in the 8 years since then.
Post reply on HN