News for hackers. Stuff that matters.
Re:How to Write a (Lisp) Interpreter (In Python) (2010) by pjmlp on Monday March 11, 2024 @07:13AM (#39666627)
Given Peter Norvig's work on Lisp and Python, pity that after 24 years, his "Python for Lisp Programmers" essay from 2000 is still mostly true.

Python might have overtaken Lisp's role in AI, but still needs some catching up in tooling.

"The two main drawbacks of Python from my point of view are (1) there is very little compile-time error analysis and type declaration, even less than Lisp, and (2) execution time is much slower than Lisp, often by a factor of 10 (sometimes by 100 and sometimes by 1). Qualitatively, Python feels about the same speed as interpreted Lisp, but very noticably slower than compiled Lisp. For this reason I wouldn't recommend Python for applications that are (or are likely to become over time) compute intensive (unless you are willing to move the speed bottlenecks into C). But my purpose is oriented towards pedagogy, not production, so this is less of an issue. "

-- https://norvig.com/python-lisp.html

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by housecarpenter on Monday March 11, 2024 @08:11AM (#39667143)
> (1) there is very little compile-time error analysis and type declaration

There's been a lot of improvement on that front.

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by vindarel on Monday March 11, 2024 @08:22AM (#39667252)
It's still… not the same. In CL (and specially with SBCL), we get compile time (type) errors and warnings at the blink of an eye, when we compile a single function with a keystroke (typically C-c C-c in Slime).

And there's also been improvement, see Coalton for a ML on top of CL. (https://github.com/coalton-lang/coalton/) (and SBCL itself evolves)

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by housecarpenter on Monday March 11, 2024 @08:46AM (#39667503)
I haven't used CL myself, but it wouldn't surprise me if CL does a better job. Just pointing out that Python is significantly better in this respect than it used to be. In particular, using VS Code with Pylance, I can see type errors highlighted as soon as I write the code---I don't even need to use a keystroke. 24 years ago, I don't think anything like that was possible; the language didn't even support type annotations.
Re:How to Write a (Lisp) Interpreter (In Python) (2010) by llm_trw on Monday March 11, 2024 @08:48AM (#39667536)
It's pretty much impossible to explain to people what it's like to work in a CL environment.

A good presentation on what we're missing: https://www.youtube.com/watch?v=8Ab3ArE8W3s

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by zarathustreal on Monday March 11, 2024 @08:57AM (#39667633)
If you’re part of the group missing something, how would you know?
Re:How to Write a (Lisp) Interpreter (In Python) (2010) by llm_trw on Monday March 11, 2024 @08:59AM (#39667655)
I use python/C for my day job and common lisp for my wacky off the clock hacking.

I used to use scheme and racket but the joy of debugging in CL is worth putting up with two (or four) name spaces.

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by Kototama on Monday March 11, 2024 @09:38AM (#39668080)
Curiosity beyond your own tools
Re:How to Write a (Lisp) Interpreter (In Python) (2010) by Qem on Monday March 11, 2024 @07:34PM (#39674421)
> Qualitatively, Python feels about the same speed as interpreted Lisp, but very noticably slower than compiled Lisp

Did you try mypyc?

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by __rito__ on Tuesday March 12, 2024 @12:50AM (#39676298)
> wouldn't recommend Python for applications that are (or are likely to become over time) compute intensive (unless you are willing to move the speed bottlenecks into C)

The compute intensive parts of AI already always happen in CUDA/C++/C.

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by pjmlp on Tuesday March 12, 2024 @04:46AM (#39677409)
The difference is that Lisp doesn't require a two language syndrome.

Julia, Mojo, XLA, Triton,... are picking up speed, and the pressure for a JIT on CPython is increasing from Microsoft and Facebook, exactly because not everything is AI, and not everyone wants to write C++, C to speed up Python.

Re:How to Write a (Lisp) Interpreter (In Python) (2010) by ja321 on Tuesday March 12, 2024 @03:14PM (#39683620)
Ok the other hand, a good lisp implementation of neural nets would offer a specific set of macros dedicated to matrix operations. This set of macros is, in the lisp point of view, a domain specific language. So, you still have 2 languages.