Live data from Hacker News

Lisp from Nothing, Second Edition

t3x.org

91–100 of 109 posts

Re: Lisp from Nothing, Second Edition

#91
post #76
post #48

Under “The Intended Audience” (page 10 of the PDF sample on the site), it says that this is not an introduction to LISP and that it would be more enjoyable with some prerequisites. Where does one — who has no knowledge of these prerequisites or about LISP (except that the latter has been heard in programming circles as something esoteric, extremely powerful, etc.) — start, before reading this book?

When I was a beginner, A Gentle Introduction to Symbolic Computation worked for me. As the title suggests, it gently introduces concepts in a very beginner friendly manner, so even macros are easy enough to grasp by the time you get there. The diagrams and examples are great. https://www.cs.cmu.edu/~dst/LispBook/book.pdf

Thanks for the recommendation. I appreciate it. I’ll definitely check this out.

Re: Lisp from Nothing, Second Edition

#92
post #48

Under “The Intended Audience” (page 10 of the PDF sample on the site), it says that this is not an introduction to LISP and that it would be more enjoyable with some prerequisites. Where does one — who has no knowledge of these prerequisites or about LISP (except that the latter has been heard in programming circles as something esoteric, extremely powerful, etc.) — start, before reading this book?

If you're already fairly comfortable with computer programming, The Little Schemer would be almost perfect for this. https://mitpress.mit.edu/9780262560993/the-little-schemer/ It would be well worth reading some of the sequel The Seasoned Schemer https://mitpress.mit.edu/9780262561006/the-seasoned-schemer/ too. In theory TLS should be accessible to anyone, but I've seen a couple of non-programmers bounce off it pretty hard. In those cases HtDP (as mentioned by m-a-t-t-i https://news.ycombinator.com/item?id=45073156 ) should hopefully be slow enough to be accessible.

Re: Lisp from Nothing, Second Edition

#95
post #79

Earlier quoted context omitted.

The metacircular evaluator shows how code is data and data is code. And in a way it’s like Maxwell’s equations. A simple proof of computation that also somehow implements a very neat language.

But of course you must close the loop by representing Maxwell's equations electromagnetically. I know this is a classic analogy, but now you've got me wondering, originally Maxwell wrote a messy pile of equations of scalrs, later someone (Gibbs?) gave them the familiar vector calculus form. Nowadays we have marvellously general and terse form, like (using the differential of the Hodge dual in naturalised units), d st…

It is a bit similar. The first versions in Lisp 1.0 and the Lisp 1.5 paper were working, but not fully refined. SICP and others later presented it a bit more refined in my opinion.

There's also version for the metacirculator interpreter written in full on M-expr, but they kinda break the spirit of things.

I think the version of eval that we have is already pretty terse for what it is. You could maybe code-golf it into something smaller, or you could code-golf it into something fully immutable.

My only gripe is that they all rely on an already existing reader that parses the expressions for you and represents them. Which is exactly what the book is about.

Finding a small enough interpretation that does ALL of it would be a dream, but I doubt it could be anywhere near as concise as the (modern) Maxwell equations.

Re: Lisp from Nothing, Second Edition

#96
post #79

Earlier quoted context omitted.

The metacircular evaluator shows how code is data and data is code. And in a way it’s like Maxwell’s equations. A simple proof of computation that also somehow implements a very neat language.

But of course you must close the loop by representing Maxwell's equations electromagnetically. I know this is a classic analogy, but now you've got me wondering, originally Maxwell wrote a messy pile of equations of scalrs, later someone (Gibbs?) gave them the familiar vector calculus form. Nowadays we have marvellously general and terse form, like (using the differential of the Hodge dual in naturalised units), d st…

It's hard to get a super compact eval for LISP with its many primitives. It's somewhat easier for the lambda calculus which inspired LISP, with obnly the 3 primitives of variable, abstraction, and application. In the binary lambda calculus this allows for a self-interpreter

    (λ 1 1) (λ λ λ 1 (λ λ λ λ 3 (λ 5 (3 (λ 2 (3 (λ λ 3 (λ 1 2 3))) (4 (λ 4
    (λ 3 1 (2 1)))))) (1 (2 (λ 1 2)) (λ 4 (λ 4 (λ 2 (1 4))) 5)))) (3 3) 2)
that tokenizes and parses a closed lambda term from a raw binary input stream and passes the term and the remainder stream to a given continuation [1].

[1] https://tromp.github.io/cl/cl.html

Re: Lisp from Nothing, Second Edition

#97
I clicked on this and immediately wanted to buy it. But then someone in the comments said to also look at your other books and well damn, now I want to read all of them and I can't choose which to start with.

Re: Lisp from Nothing, Second Edition

#98
post #48

Under “The Intended Audience” (page 10 of the PDF sample on the site), it says that this is not an introduction to LISP and that it would be more enjoyable with some prerequisites. Where does one — who has no knowledge of these prerequisites or about LISP (except that the latter has been heard in programming circles as something esoteric, extremely powerful, etc.) — start, before reading this book?

If you prefer hands-on learning, How to Design Programs is pretty good resource for the foundations, with lots of examples and exercises: https://htdp.org But learning the basics of lisp is more like a side effect, the focus is on program design.

HtDP users would probably also be interested in looking into some of the old courses based on it. List courtesy of charlysl: https://news.ycombinator.com/item?id=18891945 .

Re: Lisp from Nothing, Second Edition

#99
post #97

I clicked on this and immediately wanted to buy it. But then someone in the comments said to also look at your other books and well damn, now I want to read all of them and I can't choose which to start with.

You don't have to buy them all at once! :)

And then, at least for the compiler books, there is: http://t3x.org/files/whichbook.pdf

Re: Lisp from Nothing, Second Edition

#100
post #87
post #77

Earlier quoted context omitted.

The Revised Revised Revised Revised Revised Revised Report on the Algorithmic Programming Language Scheme (R6RS) specified that square brackets should be completely interchangeable with round brackets, which allows you to write let bindings or cond clauses like so: (let ([a (get-some-foo 1)] [b (get-some-foo 2)]) (cond [(> a b) -1] [( ...but I hate that, I'd much prefer if square brackets were only used for vectors,…

I think the R6S behavior helps with visual matching, but squanders using square brackets for something more useful (e.g. vectors), which is a shame. Another thing Clojure does is copy Arc in eliminating parentheses around the pairs of forms in let bindings and cond forms, which really aren’t needed. It just expects pairs of forms and the compiler objects if given an odd number. The programmer can use whitespace (nota…

Doing structural editing with unbracketed let bindings is pretty awful, though. And cond clauses being bracketed helps when needing multiple forms:

  (cond ((printable? foo)
         (print foo)
         (newline)
         foo)
        (else
         (print-members foo)
         newline))
True, with modern machine-generated mass-operations refactoring is easier than with older tools, but that doesn't mean a given set of brackets is 'useless'.
Post reply on HN