Live data from Hacker News

(How to Write a (Lisp) Interpreter (In Python)) (2010)

norvig.com

41–50 of 101 posts

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#41

Earlier quoted context omitted.

It's a fun thing to try, since Javascript almost was to be a Lisp at inception!

Someone once said Javascript is a "Scheme-like language with C-like syntax". Always loved that and ashamed I can't remember the original author of the quote. Not Crockford... Maybe Michael Fogus?

Not sure, but Brendan Eich originally wanted to just put Scheme in the Netscape browser but his bosses wanted something with a Java like syntax.

(I looked at Wikipedia for reference and it matches my memory of older sources.)

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#42
post #20

What I find promising about LISP is the ability to do term rewriting and macros. But people write lisps in imperative style rather than definitions of desired behaviour declaratively. I don't think we've sufficiently solved how to define desired behaviour to a computer. Term rewriting behaviours. What are your thoughts? I started trying to implement term rewriting into my LISP parser, which is the idea that we can ma…

Lisp is not the language for that unfortunately, it is very much an imperative language with better syntax and _some_ macros. Scheme is close but quotation isn't thought about nearly enough. It is generally a CS problem as logic systems with quotation are very much an open problem. I think that types have gotten too much attention and quotation way too little. Macros are basically a way to deal with the fact that nei…

I think a lot of confusion come from the fact that a lot of people (including, presumably, the parent) use "Lisp" to mean Common Lisp, whereas many others take it to mean what Common Lisp people might call "lisp" or lisp-family. You can easily have a substanceless argument this way, and many often do!

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#43

> The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024? As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of…

Second edition of Friedman's Essentials of Programming Languages is very good for this. A tough read, but very good. The second edition is written in Scheme, I think the third changed? (I can't recall the details but I know when I was hunting for reading it was recommended to stick to the second as I was specifically looking for Scheme).

https://www.librarything.com/work/347168

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#44

What I find promising about LISP is the ability to do term rewriting and macros. But people write lisps in imperative style rather than definitions of desired behaviour declaratively. I don't think we've sufficiently solved how to define desired behaviour to a computer. Term rewriting behaviours. What are your thoughts? I started trying to implement term rewriting into my LISP parser, which is the idea that we can ma…

A kind of aspect-oriented programming?

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#45
post #7

I would prefer a python interpreter written directly in rv64 assembly with a near 0-SDK. Would run on x86_64 and arm64 with a rv64 interpreter (ofc with some code paths adaptation).

I made a lisp that's somewhat close to what you described. It's a freestanding lisp that targets the Linux kernel directly. No libraries, not even libc. https://github.com/lone-lang/lone

The idea would be to write a port in rv64 assembly, and to run it in a x86_64/arm64 interpreter (for legacy support).

I am currently written rv64 assembly for some project, and at the same time I am writting a x86_64 interperter for this rv64 assembly code.

rv64 assembly is the new C.

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#46

What I find promising about LISP is the ability to do term rewriting and macros. But people write lisps in imperative style rather than definitions of desired behaviour declaratively. I don't think we've sufficiently solved how to define desired behaviour to a computer. Term rewriting behaviours. What are your thoughts? I started trying to implement term rewriting into my LISP parser, which is the idea that we can ma…

Truly futuristic programming where we we program behaviours.

Lisp is 66 years old, I think its impact on computer science has already happened.

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#47
post #7

I would prefer a python interpreter written directly in rv64 assembly with a near 0-SDK. Would run on x86_64 and arm64 with a rv64 interpreter (ofc with some code paths adaptation).

If you mean "Lisp" interpreter, then I also did something that's kinda what you're describing:

https://github.com/marcpaq/arpilisp

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#48
If you are interested in less conventional implementations of Lisp, Shinichiro Hamaji has done a few:

sed: https://github.com/shinh/sedlisp

make: https://github.com/shinh/makelisp

befunge: https://github.com/shinh/beflisp

brainfuck: https://github.com/shinh/bflisp

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#49
This might sound crazy or stupid but I really want to know if there is some Lisp with manual memory management? I love Lisp syntax. People complain about the parentheses but for me they are a blessing. I like how extremely uniform and regular they look.

But all Lisps I've seen have garbage collectors. If I could find a Lisp with manual memory management, I could ditch C++ in favor of that Lisp. Is there one?

Re: (How to Write a (Lisp) Interpreter (In Python)) (2010)

#50

This might sound crazy or stupid but I really want to know if there is some Lisp with manual memory management? I love Lisp syntax. People complain about the parentheses but for me they are a blessing. I like how extremely uniform and regular they look. But all Lisps I've seen have garbage collectors. If I could find a Lisp with manual memory management, I could ditch C++ in favor of that Lisp. Is there one?

Maybe carp or bone-lisp?
Post reply on HN