Live data from Hacker News

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

norvig.com

61–70 of 73 posts

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

#61

Earlier quoted context omitted.

First day of paradigms course in the 2000s and prof says "if your opinion of Scheme is too many parentheses, then you're an idiot." Needless to say that was my opinion and every day I think, more and more, how right he was. (later I did make some gui apps that included scripting and chose s-expr syntax because of how simple it is to implement it)

main problem isn't brackets themselves - it's that they're too on the right had brackets been displayed as curly braces in C - everything would look much more manageable

I actually find wisp [0] harder to read/write than just plain Scheme.

But there's quite a few little reader projects that swap out the first layer of syntax for another. Lisp isn't entirely tied to one representation.

[0] https://www.draketo.de/software/wisp

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

#62

Earlier quoted context omitted.

How do you mean “these kind”?

Blog tutorials, guides, programming books and youtube tutorials. They are completely irrelevant in a time where you have a personal tutor willing to explain every single detail of a subject.

Relevance is overrated. I've been writing for myself. Writing articles about the implementation of my programming language helps crystallize my knowledge. It's been remarkably effective at ensuring I won't simply forget the subject matter in the future. The fact other humans might enjoy reading my articles is just a nice bonus.

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

#64

Earlier quoted context omitted.

First day of paradigms course in the 2000s and prof says "if your opinion of Scheme is too many parentheses, then you're an idiot." Needless to say that was my opinion and every day I think, more and more, how right he was. (later I did make some gui apps that included scripting and chose s-expr syntax because of how simple it is to implement it)

There are two problems with Lisp parentheses in my opinion: 1) Humans are not that equipped to handle that level of nesting without some other aid, this is why Lisp code is usually indented. 2) Parentheses aren't just about grouping, and this is unintuitive. For example, x is not the same as (x). This is a bit like in set theory where x is not the same as {x}, but parentheses do not look like the kind of sign that wo…

I thought parentheses were fairly intuitive. They are not for grouping, more like representing an AST.

For other languages, similarly, x is not the same as x()

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

#65

Earlier quoted context omitted.

I want to see Dang’s list of fav classics :)

Sadly, https://news.ycombinator.com/favorites?id=dang is underutilized.

Yikes, I just learned from looking there that misclick favorites are a thing. Hastily un-favorited some nasty stuff.

It would be fun to build up a list of real favorites - just the sort of thing there never seems to be time for...

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

#66
post #65

Earlier quoted context omitted.

Sadly, https://news.ycombinator.com/favorites?id=dang is underutilized.

Yikes, I just learned from looking there that misclick favorites are a thing. Hastily un-favorited some nasty stuff. It would be fun to build up a list of real favorites - just the sort of thing there never seems to be time for...

It’s not like they pay you to browse Hacker News all day!

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

#67
post #66
post #65

Earlier quoted context omitted.

Yikes, I just learned from looking there that misclick favorites are a thing. Hastily un-favorited some nasty stuff. It would be fun to build up a list of real favorites - just the sort of thing there never seems to be time for...

It’s not like they pay you to browse Hacker News all day!

https://news.ycombinator.com/item?id=8123327

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

#69
I'll put in a plug for David Beazly's SICP course. While we didn't build a full Lisp interpreter, we built something similar over a week-long hands-on course. I believe his github for the course is private and only available to students. https://www.dabeaz.com/sicp.html

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

#70
Classics!

There is a different take on Lisp in Python - fakelisp. It's literally Lisp in Python, not an interpreter, but a syntax sugar library that allows embedding Lisp snippets into valid Python.

https://codeberg.org/okaleniuk/fakelisp

    from fakelisp import *

    # And now you can start mixing Python and LISP
    X = (BEGIN
        (SET (F) (LAMBDA (X)
            (IF (EQ (X) (1))
                (1)
                (MUL (X) (F (SUB (X) (1)))))))

        (LIST (F (4)) (42)))

    # Back to Python any time
    print "x: ", str(X)
Post reply on HN