News for hackers. Stuff that matters.
Re:Ask HN: Guide for Implementing Common Lisp by pfdietz on Thursday February 01, 2024 @11:29PM (#39225035)
The readtables and reader macros are entirely independent of Common Lisp compilers. The compilers work on the representation (that is, trees of cons cells) that is produced by the reader, which is after the readtables and reader macros have done their work.

If you are thinking of a Common Lisp compiler as working on a text file, you're thinking about it wrong. In Common Lisp, you can invoke the COMPILE function on a lambda expression that you cons up at runtime and that never is in a textual representation.

As a general rule, don't reimplement a Lisp except as a learning exercise (in which case, you're not going to reimplement Common Lisp; it's too big.)

Re:Ask HN: Guide for Implementing Common Lisp by HexDecOctBin on Friday February 02, 2024 @12:24AM (#39225373)
> In Common Lisp, you can invoke the COMPILE function on a lambda expression that you cons up at runtime and that never is in a textual representation.

Ah, I see. This actually clarified some of the apparently contradictory stuff I have been reading, thanks.

> As a general rule, don't reimplement a Lisp except as a learning exercise

Oh, I am much too nuts for something as simple as that, I am actually planning to write a GPU-targeted language with ALGOL-syntax and Lisp-metaprogramming and REPL-driven-ish development. Wish me luck!

Re:Ask HN: Guide for Implementing Common Lisp by el_memorioso on Friday February 02, 2024 @01:15AM (#39225657)
Why m-expressions (Algol syntax)? McCarthy initially tried m-expressions for Lisp, but it turned out that programmers liked s-expressions better.
Re:Ask HN: Guide for Implementing Common Lisp by pfdietz on Friday February 02, 2024 @08:15AM (#39228163)
In particular, macros work great with s-expressions, not so great with m-expressions.
Re:Ask HN: Guide for Implementing Common Lisp by HexDecOctBin on Friday February 02, 2024 @09:33AM (#39228913)
There has been some new research around this old problem, which inspired me: https://dl.acm.org/doi/10.1145/3622818
Re:Ask HN: Guide for Implementing Common Lisp by rokkitmensch on Friday February 02, 2024 @10:23AM (#39229642)
I salute your honest madness.