Skip to content

Comment on Ask HN: What does a developer need to know to build their own Lisp from scratch?

Comments

Why is Lisp/Scheme a good candidate for something to implement oneself? Because it has hardly any syntax, so writing the parser is relatively easy compared to writing the parser for other languages.

What's at the heart of Lisp that makes it so simple and elegant?

In terms of implementing it, probably the Cons Cell. The insight being that the heart of Lisp is pairs, not lists:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Co...

https://cs.gmu.edu/~sean/lisp/cons/

The parser for Scheme is simple because it doesn't have reader macros. The parser for common lisp can't really be simple (see [0] describing building a JSON syntax extension to common lisp within common lisp).

If by "lisp" people just mean s-expressions then yes s-expressions are really easy to parse.

[0] https://gist.github.com/chaitanyagupta/9324402

When a neophyte is excited about Lisp, they mean s-expressions and eval. We shouldn't ask them Lisp-1 or Lisp-2, or Scheme? Or reader macros. We should throw them a helping hand to expand their computational universe.

We should always seek to educate the pupil graciously.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.