Live data from Hacker News

Python 3.13 Gets a JIT

tonybaloney.github.io

541–550 of 553 posts

Re: Python 3.13 Gets a JIT

#541
post #27

Finally! Regardless of the work being done in PyPy, Jython, GraalPy and IronPython, having a JIT in CPython seems to be the only way beyond "C/C++/Fortran libs are Python" mindset. Looking forward to its evolution, from 3.13 onwards.

The only way to achieve C/C++/Fortran efficiency is a statically compiled, strongly typed language. Witness the effort put into Java JITC and the rest of the modern Java (and Graal) runtime. Still well short of the promised “C equivalence”. To me, Mojo looks like the best approach to fusing that with the Python ecosystem! (I have no doubt about it being open sourced at some point.)

JIT and static typing are not mutually exclusive or necessarily opposed. For example, MKL added JIT for small matrix multiplications quite a while ago.

https://www.intel.com/content/www/us/en/developer/articles/t...

I think people just reach for JIT more often in dynamic languages because they carry more information around and have more of a performance deficit that they want to mitigate.

I dunno. I mostly program in Fortran but JIT seems way cool. Fundamentally I don’t see why a JITer couldn’t beat my code in a very dynamic language, it would just need to find a big loop that calls a kernel a bunch of times, where the exact computation in the kernel is determined at run-time, and then jit the kernel and the loop together.

Re: Python 3.13 Gets a JIT

#542

Earlier quoted context omitted.

> If something gets 10% faster twice it actually got 19% faster 21%, not 19%. It is 1.1 * 1.1 = 1.21 You are right in the opposite direction. If it got 10% slower, then it is 0.9 * 0.9 = 0.81 = 19% slower

It's easy to see there must be something wrong with this since if you get 10% faster 8 times, we can be sure that this doesn't mean you're 114% faster (1.1^8 = 2.14). You can't get more than 100% faster! When you say something is 10% faster, what you mean is it took 10% less time to finish. So 19% is correct.

100 percent faster means doubling the speed,just like a 100 percent salary increase means doubling the salary, or 100 percent car speed increase means doubling its speed.

Unless one uses a bit more esoteric definition of speed, in which a 50 percent of car speed increase, makes it go from 100 km/h to 200 km/h, such that it arrives in half the time.

Re: Python 3.13 Gets a JIT

#543
post #76
post #69

Earlier quoted context omitted.

is it any different or comparable to numba or pyjion? Not following python closely in recent years but I recount those two projects with huge potential

I don’t know Pyjion, but I have used Numba for real work. It’s a great package and can lead to massive speed-ups. However, last time I used it, it (1) didn’t work with many third-party libraries (e.g. SciPy was important for me), and (2) didn’t work with object-oriented code (all your @njit code had to be wrapped in functions without classes). Those two has limited for which projects I could adopt Numba in practice,…

FWIW, I use numba's (experimental) jitclass pretty successfully in my projects.

(Actually a monkey-patched version to be able to set njit arguments)

Re: Python 3.13 Gets a JIT

#544

Earlier quoted context omitted.

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.

Python is Best Practice (tm)? What do you mean?

Right now, if you develop something in Python, not many people complain at you, although some might say you shoulda used JS and some of them might be right....

Maybe not absolute best practice, but it's not like PHP or Ruby or Perl, where there's rarely ever any new projects everyone blogs about using them.

All the big web frameworks are still maintained, there are still new coders learning it, it's not a language that will make people be like "Oh ew, I'm not learning that language just to work on that", etc.

Re: Python 3.13 Gets a JIT

#545
There will always be a reason to use a language other than Python, but I'm finding more and more, 'why not use python'?

Sure when my website/app/software gets 10k concurrent users, I might regret it, but I havent regretted it yet.

Re: Python 3.13 Gets a JIT

#546

Earlier quoted context omitted.

Python is a very widely used language, and like any popular thing, yes many many many like it , and many many many dislike it .. it is that big, python can be disliked by a million developer and still be a lot more liked than disliked but i also think that its true that python is not and have not been for a while considered as a modern or technically advanced language the hype currently is for typed or gradually type…

> but for devs passionate about programming languages, python is a relic they hope vanish Such devs are increasingly rare and, in some domains, almost nonexistent. For example, Kotlin borrowed a lot of nice features from Scala and Groovy, yet 99% of Kotlin code I've seen professionally never touched those features. Kotlin on Android seems to be overwhelmingly written by barely (or not at all) re-trained Java devs; mo…

i really like this opinion, a large percentage of developers write procedural code in any language, libraries and market demand is their main decision criteria, not language features

Re: Python 3.13 Gets a JIT

#548
post #447

[flagged]

Could you please stop posting flamewar comments, in particular about Python? You've done it repeatedly in this thread, as well as on many other occasions (e.g. https://news.ycombinator.com/item?id=38010109 ), and we've already had to ask you more than once to stop: https://news.ycombinator.com/item?id=38270168 (Nov 2023) https://news.ycombinator.com/item?id=37807607 (Oct 2023) This is not about Python, it's about not…

Well, as to the news guidelines... I'm sorry to say this, but they are either very easy to interpret many different ways, or are very frequently violated. I'm not complaining though. Any rule-based system to govern societies big or small will either be too rigid, or to prone to individual (mis-)interpretation.

As for tedious squabbles, you seem to be the only one commenting on this post. You also don't seem to be interested in the subject. So, I don't see much potential for the squabble.

----

Anyhow. Since you welcomed a meta-response... here's another story. This time not a folk tale.

Before Adobe bought Macromedia, Macromedia was in the process of revamping its tooling and workflows around Flash. They've created an open-source framework that included a compiler -- something that allowed for a much wider audience to start writing in ActionScript. They also significantly upgraded the language. The transition from AS2 to AS3 was in some ways more difficult than from Python 2.X to Python 3.X. Similar to how Python transition created a lot of zealotry, everyone in the world of Flash who wanted to post their opinion on the Web was cursing the old and praising the new.

At the time I was a moderator on a user board dedicated to Flash and ActionScript. Just like everyone around me, I was hyped up about the advent of the new version of the language. Well, it wasn't every one though. There was one member of the forum who found himself in opposition to everyone around himself. He believed that the transition to AS3 was without merit, for show, a waste of time.

Every time he'd appear in any forum thread, the discussion would inevitably shift towards AS2 vs AS3. At the time I thought he was ridiculously wrong... but the actual problem wasn't him being wrong. It was the quality of counter-arguments. Whenever someone disagreed with him, the counter-argument was laughably bad. So, let's call him "the AS2 guy", would spend time deconstructing the counter-argument showing how it's just a bad argument... but it was too much to read, and by the time there was a reply, there'd be a queue of more counter-arguments of similarly laughably low quality.

Not surprisingly, the AS2 guy would get upset, threads would grow very long, eventually mods would start deleting posts and... temporary ban the AS2 guy. That is until we banned him permanently. I kind of felt bad for the guy, but thought it was for the greater good...

As you can imagine, I believe I was wrong to ban him (well, the decision wasn't entirely mine, but that's going into too much detail). But this isn't the only thing I came to regret following the development of Web forums over last few decades. Below are some unfortunate revelations that I had at different times in connection to public discourse:

* Opinions of more knowledgeable people are more polarized.

* Most people in programming trade, if compared to other knowledge workers, have very little knowledge of their own trade.

* Programmers have many naive beliefs about other areas of knowledge, believing ourselves to be experts in those fields for no good reason. This is particularly relevant when talking about programmers designing rules for online communities.

As a result, programmers are very prone to creating self-reinforcing information bubbles. Designing and manipulating the rules of the system to secure a win of the opinion they subscribe to instead of refining their opinion to account for counter-arguments. The systems thus built are made to be less and less tolerant of a difference of opinion. Every superficially inclusive initiative, s.a. popular today "codes of conduct", becomes an instrument for fighting dissent.

So, to tie back the story to the argument I'm trying to make: yes, of course I think Python is an awful technology. Yes, I never pretended that the people behind it are doing a good job. It's awful and it only gets worse. I also wrote plenty about the "why" side of things. I've never came across anything close to a convincing argument to the opposite, not here not in any other public forum that discusses Python. But there's often a lot of laughably bad arguments.

If you choose to see my opinion as a violation of the forum rules -- that's up to you of course. But banning me for this will not make Python better, nor will it have any impact on my opinion, nor on my willingness to share it. It will, however, make some people feel better about themselves for a while. There's of course a possibility of remorse, but it doesn't come to everyone, and definitely not in a timely way.

Re: Python 3.13 Gets a JIT

#549
> The initial benchmarks show something of a 2-9% performance improvement. You might be disappointed by this number, especially since this blog post has been talking about assembly and machine code and nothing is faster than that right? Well, remember that CPython is already written in C and that was already compiled to machine-code by the C compiler.

WTF has this to do with JITing the code written in Python?

Re: Python 3.13 Gets a JIT

#550
post #361

Earlier quoted context omitted.

log(2)÷log(1.1) ~= 7.27, so in principle sustained 10% improvements could double performance every 7 releases. But at some point we're bound to face diminishing returns.

.9 * x = 0.5 x ln 0.9 = ln 0.5 x = ln 0.5 / ln 0.9 x = 6.5788 So decreasing runtime by 10% 6.5788 times results in the code running in half the original time.

I think their number is the right one. Ten percent faster is not a ten percent decrease in runtime, it's about a nine percent decrease.
Post reply on HN