News for hackers. Stuff that matters.
Re:Advanced Python: Achieving High Performance with Code Gen... by assanineass on Friday September 06, 2024 @10:23AM (#41466508)
New Title - Advanced Python: Just Program in C
Re:Advanced Python: Achieving High Performance with Code Gen... by pjmlp on Friday September 06, 2024 @10:40AM (#41466653)
Advanced Python - Rediscovering Common Lisp.
Re:Advanced Python: Achieving High Performance with Code Gen... by PaulHoule on Friday September 06, 2024 @11:06AM (#41466875)
A while back I concluded that you could code up most of the examples from

https://www.amazon.com/Paradigms-Artificial-Intelligence-Pro...

in Python without doing anything too out of the ordinary. I just finished

https://www.amazon.com/Lisp-Advanced-Techniques-Common/dp/01...

and came to almost the same conclusion in that most of the macro use in that book is in the syntactic sugar or performance optimization category. If I didn't have a lot of projects in the queue and people demanding my time I'd try coding up the ATN and Prolog examples in Python (sorta kinda did the "CLOS" example in that I built a strange kind of meta-object facility that made "objects" backed by RDF triples)

In Java I did enough hacking on this project

https://github.com/paulhoule/ferocity/blob/main/ferocity0/sr...

to conclude I could create something that people who think "Java Sux" and "Common Lisp Sux" would really hate. If I went forward on that it would be to try "code golf not counting POM file size" by dividing ferocity into layers (like that ferocity0 which is enough to write a code generator that can stub the whole stdlib) so I could use metaprogramming to fight back against the bulkification you get from writing Java as typed S-expressions. (I'm pretty sure type erasure can be dealt with if you aren't interested in JDK 10+ features like var and switch expressions, on the other hand a system like that doesn't have to be able to code generate syntactic sugar sorts of structures because ferocity is all about being able to write syntatic sugar)

Re:Advanced Python: Achieving High Performance with Code Gen... by pjmlp on Friday September 06, 2024 @11:58AM (#41467294)
With the difference that Python code runs slow as molasses.
Re:Advanced Python: Achieving High Performance with Code Gen... by PaulHoule on Friday September 06, 2024 @12:07PM (#41467374)
I've had very good luck with PyPy speeding up branchy "old AI" code.

Some days I wonder if the popularity of Lisp around MIT was really an attempt to stick Noam Chomsky for biting the hand that feeds them.

Re:Advanced Python: Achieving High Performance with Code Gen... by pjmlp on Friday September 06, 2024 @12:13PM (#41467431)
The black Swan of Python ecosystem.
Re:Advanced Python: Achieving High Performance with Code Gen... by medo-bear on Friday September 06, 2024 @04:02PM (#41469285)
Interesting comment, what does Noam Chomsky have to do with Lisp?
Re:Advanced Python: Achieving High Performance with Code Gen... by PaulHoule on Friday September 06, 2024 @04:50PM (#41469615)
Almost every other programming language uses parsing technology related to Chomsky’s generative grammars, Lisp is the conspicuous exception.
Re:Advanced Python: Achieving High Performance with Code Gen... by kazinator on Friday September 06, 2024 @11:38PM (#41471291)
Don't forget that Chomksy probably spent a vast amount of time inserting labeled brackets into lists of words to show their syntax!

And it wasn't his choice or fault that they are aren't there.

Re:Advanced Python: Achieving High Performance with Code Gen... by adtezrh on Friday September 06, 2024 @10:50AM (#41466748)
Ad-hoc, informally specified and bug-ridden (Greenspun's tenth rule applies very much to Python).

I'm not criticizing the article, which humorously draws Dr.Strangelove analogies to these techniques. What I don't understand is that this sort thing has been popular for over 20 years in the Python space.

Re:Advanced Python: Achieving High Performance with Code Gen... by pjmlp on Friday September 06, 2024 @11:01AM (#41466830)
At least some are doing numeric research right.

"Common Lisp using LLVM and C++ for Molecular Metaprogramming"

https://sungsoo.github.io/2015/06/17/clap.html

Re:Advanced Python: Achieving High Performance with Code Gen... by bmitc on Friday September 06, 2024 @01:54PM (#41468296)
You can go to several dozen of languages from Python to get better and far more easier performance without having to go to C. C can have performance, but you have to pay with it.
Re:Advanced Python: Achieving High Performance with Code Gen... by bmitc on Friday September 06, 2024 @04:01PM (#41469272)
* pay for it