Live data from Hacker News

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

norvig.com

61–70 of 101 posts

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

#62

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…

[deleted]

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

#63

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?

[deleted]

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

#64

Earlier quoted context omitted.

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.)

Every time I'm reminded of that I get annoyed thinking of how much better the web could have been.

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

#65
post #19

Or you can just from fakelisp import * And turn your Python into a Lisp. https://github.com/akalenuk/fakelisp

Not exactly the same (doesn't embed into the source like this did), but I believe Hylang[0] is the best Lisp package available for modern Python. [0] https://github.com/hylang/hy

Calysto Scheme would like a word: https://github.com/Calysto/calysto_scheme

Hy is pretty much Lisp-like syntactic sugar over Python semantics. Calysto is a full scheme implementation.

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

#67

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?

I bet you could go quite far writing a straightforward compiler using an S-expr syntax.

Any by a "compiler" I'm talking doing something simply like taking Pascal, converting it to an s-expr grammar, and going to town.

Scheme can be a simple algol style language. Using s-expr syntax just made your lexer/parser much simpler. And (simple) compilation is really not that hard (just compile it to C for your first crack if you want).

I bet you could get quite far quite quickly.

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

#68
post #55

Earlier quoted context omitted.

Lisp is eldritch by programming language standards; we are still wrestling with the ramifications of McCarthy's half-page of code.

You think lisp is "weird and sinister or ghostly" and that 'we' are still wrestling with something 66 years later? This sounds more like someone getting caught up in the pageantry of a niche that pragmatic people have left behind a long time ago. Lisp was very influential, but those advancement have made their way into practical languages and lisp has been impractical for many decades at this point.

Ah yes, all of the modern practical languages allow you to connect to a running system, redefine a class, and automatically update every existing instance of that class.

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

#70
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…

What is the requirement defining "first class quotation"?

In support of ways of implementing Scheme hygienic macros, there exists an invention known as syntactic closures. In what ways does a syntactic closure fall short of being a "first class quotation"?

Post reply on HN