News for hackers. Stuff that matters.
Re:Python-based compiler achieves orders-of-magnitude speedups by ginko on Wednesday March 15, 2023 @07:30AM (#35166597)
nit: 'Python-based' would imply to me that it's written in Python, but it looks like it's mostly C++ & LLVM:

https://github.com/exaloop/codon/tree/develop/codon

Re:Python-based compiler achieves orders-of-magnitude speedups by pgt on Wednesday March 15, 2023 @07:37AM (#35166670)
Hardly a nitpick. It's key to the claim.
Re:Python-based compiler achieves orders-of-magnitude speedups by nerdponx on Wednesday March 15, 2023 @07:55AM (#35166853)
It's a little sad because PyPy literally is written in (a restricted subset of) Python, hence the name.
Re:Python-based compiler achieves orders-of-magnitude speedups by v3ss0n on Wednesday March 15, 2023 @08:31AM (#35167260)
And it is severely underrated. Even though performance gain is aevrate around 4x-20x. Used in production and memory usage is also about 1/6th of CPython. Can get 10x perfromance easily in many cases.
Re:Python-based compiler achieves orders-of-magnitude speedups by ddorian43 on Wednesday March 15, 2023 @08:42AM (#35167398)
> Used in production and memory usage is also about 1/6th of CPython

I thought it would have higher memory usage? (based only on reading)

Re:Python-based compiler achieves orders-of-magnitude speedups by smolder on Wednesday March 15, 2023 @09:45AM (#35168236)
I suspect their relative memory efficiency depends on the size of the program and the size of the data it's processing.
Re:Python-based compiler achieves orders-of-magnitude speedups by chc on Wednesday March 15, 2023 @11:28AM (#35169797)
Somewhat paradoxically, PyPy always uses more memory for programs with small working sets, but can use less memory for programs with large working sets. 1/6 is a lot more extreme than I would have expected, though.
Re:Python-based compiler achieves orders-of-magnitude speedups by rurban on Friday March 17, 2023 @01:54AM (#35193667)
No, it has drastically less memory requirements. It's very similar to my perl compiler, and even in non-optimizing mode it uses much less memory. In optimizing mode it's almost the same as this one. Just ~20 years older.
Re:Python-based compiler achieves orders-of-magnitude speedups by avinassh on Wednesday March 15, 2023 @09:44AM (#35168225)
I experimented with SQLite, trying to insert many rows in under a minute. I ran my script with PyPy, with zero changes and it was 4x times faster!

code here: https://github.com/avinassh/fast-sqlite3-inserts

my blog post: https://avi.im/blag/2021/fast-sqlite-inserts/

Re:Python-based compiler achieves orders-of-magnitude speedups by avgcorrection on Wednesday March 15, 2023 @05:55PM (#35175270)
What does “literally” buy you here?
Re:Python-based compiler achieves orders-of-magnitude speedups by chc on Wednesday March 15, 2023 @11:19AM (#35169664)
It's a nit-pick because it's ultimately just a gripe about ambiguous phrasing, not because the implications of what the phrasing means are unimportant.
Re:Python-based compiler achieves orders-of-magnitude speedups by scott_s on Wednesday March 15, 2023 @09:37AM (#35168131)
A fair implication, but they mean "Python-based" in that the language the compiler implements is based on Python.
Re:Python-based compiler achieves orders-of-magnitude speedups by benj111 on Wednesday March 15, 2023 @10:01AM (#35168466)
They should have said python compiler (shorter) or python compiler in c++ (more accurate and only one character longer, including spaces).

Considering at least 2 people have gone to look at the source and then come here to comment, it would have been a net benefit for all involved. Plus, what does it say about the potential quality of your compiler if you can't even make correct English statements? This seems easier to get right than if( x = *p++ )

Re:Python-based compiler achieves orders-of-magnitude speedups by jbylund on Wednesday March 15, 2023 @10:40AM (#35168984)
These headlines usually work by the dept asking a researcher for a 10 sentence summary of their work. Someone in the dept summarizes that to 3 sentences, and sends that to the university pr dept. The university turns that 3 sentences into 1 and that's what's published. My take is this says more about the weird game of telephone being played than it does about the research product itself.
Re:Python-based compiler achieves orders-of-magnitude speedups by nightpool on Wednesday March 15, 2023 @10:51AM (#35169187)
Yes, but it's a game of telephone that does make it annoying for HN readers to try and actually understand what's being presented, so it should be discussed and corrected if possible.
Re:Python-based compiler achieves orders-of-magnitude speedups by xdavidliu on Wednesday March 15, 2023 @10:58AM (#35169313)
true, but if that's the case, then the game of telephone would not call (haha) into question the quality of the compiler, since the devs were not responsible for the game.
Re:Python-based compiler achieves orders-of-magnitude speedups by daquisu on Wednesday March 15, 2023 @10:25AM (#35168774)
> This seems easier to get right than if( x = *p++ )

For people with native or fluent English, for sure. For the others, probably not.

Re:Python-based compiler achieves orders-of-magnitude speedups by benj111 on Wednesday March 15, 2023 @11:24AM (#35169737)
What level of English fluency should we expect of professors at MIT and writers for their site?
Re:Python-based compiler achieves orders-of-magnitude speedups by xapata on Wednesday March 15, 2023 @02:19PM (#35172479)
_The Shaft_, a Georgia Tech periodical (similar to _The Onion_ in spirit), interviewed a local associate professor: "How can I be expected to teach math if my students don't speak basic Mandarin?"
Re:Python-based compiler achieves orders-of-magnitude speedups by chc on Wednesday March 15, 2023 @11:17AM (#35169637)
1. It currently only compiles a subset of Python, which is presumably why they said it was based on Python rather than Python.

2. There are lots of good developers who aren't capable of making any statements in English.

Re:Python-based compiler achieves orders-of-magnitude speedups by capableweb on Wednesday March 15, 2023 @11:34AM (#35169901)
Github reports it's 55% C++ and 43% Python, not too bad if it's correct.
Re:Python-based compiler achieves orders-of-magnitude speedups by ginko on Wednesday March 15, 2023 @12:51PM (#35171134)
I would expect a large chunk of the 43% Python to be tests.
Re:Python-based compiler achieves orders-of-magnitude speedups by capableweb on Wednesday March 15, 2023 @07:30PM (#35176134)
Yeah, that'd make sense. Good point.