News for hackers. Stuff that matters.
Re:Python-based compiler achieves orders-of-magnitude speedups by _gtly on Wednesday March 15, 2023 @08:40AM (#35167367)
Paper here: "Codon: A Compiler for High-Performance Pythonic Applications and DSLs": https://dl.acm.org/doi/pdf/10.1145/3578360.3580275
Re:Python-based compiler achieves orders-of-magnitude speedups by rightbyte on Wednesday March 15, 2023 @11:35AM (#35169912)
Ye well if you remove the dynamic feutures of a dynamic language it gets fast. It would be really impressive of they can achieve those feutures with the sameish speed.
Re:Python-based compiler achieves orders-of-magnitude speedups by brucethemoose2 on Wednesday March 15, 2023 @12:08PM (#35170473)
I dont necessarily need all that dynamism though, and would happily use a Python subset that removed some stuff (and forced type hinting) in exchange for better compilation.

Yes there are already subsets like this, but its not as helpful if it isnt standard.

Re:Python-based compiler achieves orders-of-magnitude speedups by BiteCode_dev on Wednesday March 15, 2023 @01:22PM (#35171674)
Depends of the work you have to do.

If you code a website, fast api and django, the two most popular framework to do so, heavily rely on them to make you productive.

Re:Python-based compiler achieves orders-of-magnitude speedups by bravura on Wednesday March 15, 2023 @01:51PM (#35172109)
If you code a website, your speed issues probably come from the database layer. Not your Python.
Re:Python-based compiler achieves orders-of-magnitude speedups by FridgeSeal on Wednesday March 15, 2023 @05:17PM (#35174840)
What are you doing to your database? Lol

Most databases I’ve dealt with will happily outstrip Python for a good chunk of the common queries.

Re:Python-based compiler achieves orders-of-magnitude speedups by DougMerritt on Wednesday March 15, 2023 @05:32PM (#35175021)
Measuring database speed is ultimately I/O bound, measuring a language's speed is typically CPU-bound.
Re:Python-based compiler achieves orders-of-magnitude speedups by Doxin on Thursday March 16, 2023 @04:26AM (#35179533)
For sure, but django for instance is really good at turning something that ought to be one query into N+1 queries.
Re:Python-based compiler achieves orders-of-magnitude speedups by fud101 on Thursday March 16, 2023 @08:48AM (#35181168)
how do you deal with this?
Re:Python-based compiler achieves orders-of-magnitude speedups by WhatTheFlak on Thursday March 16, 2023 @08:08PM (#35190798)
Don't abuse the damn ORM.

And write SQL directly for medium complexity queries.

Re:Python-based compiler achieves orders-of-magnitude speedups by Doxin on Friday March 17, 2023 @10:09AM (#35197287)
In my experience? optimize things once it turns out to be a problem. It's not easy though and one of the many reasons I don't love the django ORM.
Re:Python-based compiler achieves orders-of-magnitude speedups by echelon on Wednesday March 15, 2023 @04:10PM (#35174061)
Starlark comes to mind, but that's probably too limited.
Re:Python-based compiler achieves orders-of-magnitude speedups by msla on Wednesday March 15, 2023 @12:06PM (#35170451)
I wonder what experienced Common Lisp compiler devs could accomplish if they turned their attention to Python.
Re:Python-based compiler achieves orders-of-magnitude speedups by LispSporks22 on Wednesday March 15, 2023 @12:38PM (#35170927)
There is an implementation of Python in Common Lisp https://clpython.common-lisp.dev/ but I think you probably mean some more lower-level thing
Re:Python-based compiler achieves orders-of-magnitude speedups by msla on Wednesday March 15, 2023 @04:49PM (#35174519)
I do: I mean some people with experience making Common Lisp implementations (SBCL, maybe) getting an idea and implementing Python with the same basic concepts they used to implement a Common Lisp compiler.
Re:Python-based compiler achieves orders-of-magnitude speedups by Mikhail_K on Wednesday March 15, 2023 @12:30PM (#35170795)
Re:Python-based compiler achieves orders-of-magnitude speedups by fud101 on Thursday March 16, 2023 @08:50AM (#35181187)
no thanks, julia is a nicer matlab. python is a proper general purpose language.
Re:Python-based compiler achieves orders-of-magnitude speedups by Mikhail_K on Thursday March 16, 2023 @01:36PM (#35185287)
Julia is not a proper general purpose programming language, because it has one-based array indexing?
Re:Python-based compiler achieves orders-of-magnitude speedups by _a_a_a_ on Wednesday March 15, 2023 @02:42PM (#35172834)
I'm sure this is a great project worthy of HN front page reporting but if it can't run python generally,it ain't python.
Re:Python-based compiler achieves orders-of-magnitude speedups by jojohohanon on Thursday March 16, 2023 @09:00AM (#35181308)
Isn’t it “self”, really? [1]

Assume your python program is fully static and well behaved from a compiler perspective. JIT compile it, and observe what it does, so that you can invalidate the compiled code and re-JIT it if it does something overly dynamic.

Incidentally, what JVM did. (I’m sure now it’s been tweaked beyond recognition)

[1] https://bibliography.selflanguage.org/pics.html