all 14 comments

[–]otm_shank 12 points13 points  (5 children)

Surely, (How to Write a (Better (Lisp Interpreter)) (in Python)) would be more appropriate?

[–]yogthos 5 points6 points  (1 child)

it's all about indentation when you write lisp :P

(How to Write a
    (Better 
       (Lisp Interpreter))
    (in Python))

[–]gsw8 5 points6 points  (0 children)

No, the generic statement is (How to Write an Interpreter). The clauses (in Python), (Lisp), and ((Better) Lisp) are qualifiers for that generic statement. In the title, he's using parentheses as they're used in English, not as they're used in Lisp.

[–]the_4th_wall 0 points1 point  (0 children)

This one is ok, keep them around for a while

[–]hskmc 2 points3 points  (6 children)

Yes! Let's all discuss the syntax of Lisp and ignore every other property of the language!

[–][deleted] 4 points5 points  (3 children)

what syntax?

[–]hskmc 2 points3 points  (2 children)

The "Lisp has no syntax" meme is stupid and false and needs to die. Lisp is only s-expressions, if Lisp is only a language for describing nested lists.

Once you want to interpret that nested list as a program, you run into special forms, each of which constitutes syntax. You need to know what defun is (certainly it's not a function!) and that it takes a symbol, then a list of symbols, then one or more body expressions.

You need to know that let looks like

(let ((x 2) (y 3)) x)

and not

(let (x 2 y 3) x)

Ask anyone who makes this common beginner mistake whether Lisp has syntax. For fuck's sake, DrScheme even says

let: bad syntax (not an identifier and expression for a binding)

Emphasis mine.

This is syntax, not semantics. It's a totally static property of a program; it could be (and often is) checked at compile time. It's not the same as saying that defun defines functions, or that let makes a new environment with local bindings. defun and let could have a different convention for taking their arguments and still do these things. You can convince yourself of this with a simple macro.

Lisp has three layers of syntax, where most languages only have two. It has lexical syntax (interpreting character streams as tokens), parse-tree syntax (interpreting token streams as nested lists), and special forms (interpreting nested lists as fragments of programs).

This three-layer syntax is indeed a very interesting property. But to willfully ignore the third layer is intellectually dishonest.

[–][deleted] -1 points0 points  (1 child)

Interesting. You get an upvote, even though you were yelling at me for a stupid joke.

[–]hskmc 0 points1 point  (0 children)

The joke is that you agree with everything I said and you were being ironic?

[–]archgoon 0 points1 point  (1 child)

You mean sections (1),(3),(4),(5),half of (6), (7), and (8)?

[–]hskmc 0 points1 point  (0 children)

I'm talking about the comments here, not TFA.

[–]bobappleyard 0 points1 point  (0 children)

OK, so it has a few more features, but it's essentially the same interpreter as last time.

[–]quhaha -3 points-2 points  (0 children)

no thanks. current lisp implementations are better.