Live data from Hacker News

Lisp from Nothing, Second Edition

t3x.org

101–109 of 109 posts

Re: Lisp from Nothing, Second Edition

#101

The entire website of the author is worth exploring: https://t3x.org/index.html I love it so much, and seeing your bibliography makes me feel like a kid in a candy store. The confluence of Asian philosophy and computing is delightful. To put you in the correct headspace this Saturday morning: https://t3x.org/whoami.html

Where is the bibliography? (I searched for it, but couldn't find it, expecting to find a list of books which the author referenced in writing/researching)

Re: Lisp from Nothing, Second Edition

#102
post #100
post #87

Earlier quoted context omitted.

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'.

I think it's a matter of whether you're programming in a mostly applicative way† or in a more imperative way. Especially in the modern age of generational GC, Lisp cons lists support applicative programming with efficient applicative update, but sacrifice efficiency for certain common operations: indexing to a numerical position in a large list, appending to a list, or doing a lookup in a finite map such as an alist. So, in Common Lisp or Scheme, we are often induced to use vectors or hash tables, sacrificing applicative purity for efficiency—thus Perlis's quip about how purely applicative languages are poorly applicable, from https://www.cs.yale.edu/homes/perlis-alan/quotes.html.

In general a sequence of expressions of which only the value of the last is used, like C's comma operator or the "implicit progn" of conventional cond and let bodies, is only useful for imperative programming where the non-last expressions are executed for their side effects.

Clojure's HAMTs can support a wider range of operations efficiently, so Clojure code, in my limited experience, tends to be more purely applicative than code in most other Lisps.

Incidentally, a purely applicative finite map data structure I recently learned about (in December 02023) is the "hash trie" of Chris Wellons and NRK: https://nullprogram.com/blog/2023/09/30/. It is definitely less efficient than a hash table, but, in my tests so far, it's still about 100ns per hash lookup on my MicroPC and 250ns on my cellphone, compared to maybe 50ns or 100ns respectively for an imperative hash table without FP-persistence. It uses about twice as much space. This should make it a usable replacement for hash tables in many applications where either FP-persistence, probabilistically bounded insertion time, or lock-free concurrent access is required.

This "hash trie" is unrelated to Knuth's 01986 "hash trie" https://www.cs.tufts.edu/~nr/cs257/archive/don-knuth/pearls-..., and I think it's a greatly simplified HAMT, but I don't yet understand HAMTs well enough to be sure. Unlike HAMTs, it can also support in-place mutating access (and in fact my performance measurements above were using it).

______

† sometimes called "functional", though that can alternatively refer to programming with higher-order functions

Re: Lisp from Nothing, Second Edition

#103
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

That's super helpful! I downloaded the samples for S9fES and LfN, checking those out first. I love how generous you are with the number of pages in the free samples by the way.

Re: Lisp from Nothing, Second Edition

#105

The entire website of the author is worth exploring: https://t3x.org/index.html I love it so much, and seeing your bibliography makes me feel like a kid in a candy store. The confluence of Asian philosophy and computing is delightful. To put you in the correct headspace this Saturday morning: https://t3x.org/whoami.html

Where is the bibliography? (I searched for it, but couldn't find it, expecting to find a list of books which the author referenced in writing/researching)

“Bibliography” is a word used in practice with multiple meanings; the dictionary prepared by Oxford Dictionaries for Google (https://languages.oup.com/google-dictionary-en/) gives (https://www.google.com/search?q=define%3Abibliography) three meanings:

> • a list of the books referred to in a scholarly work, typically printed as an appendix.

> • a list of the books of a specific author or publisher, or on a specific subject. "a bibliography of his publications"

> • the history or systematic description of books, their authorship, printing, publication, editions, etc. "he regarded bibliography as a science"

In this context clearly the second meaning is meant (https://t3x.org/index.html#books); this also corresponds to meaning 2 at Wiktionary (https://en.wiktionary.org/w/index.php?title=bibliography&old...) or 2b at Merriam-Webster (https://www.merriam-webster.com/dictionary/bibliography).

> a list of works written by an author or printed by a publishing house “compiled a complete bibliography of John Donne”

Re: Lisp from Nothing, Second Edition

#106
post #100
post #87

Earlier quoted context omitted.

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'.

I wouldn’t go as far as “pretty awful,” but yes, it’s a keystroke more to manipulate two sequential forms instead of one. And yes, there is a slight indentation advantage when the test and the conditional code won’t fit on the same line. It’s easy enough to use “do” when the conditional clause has multiple forms, however. Personally, I’ll take those trade offs for the reduction in clutter.

Re: Lisp from Nothing, Second Edition

#108
post #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 prett…

Thank you very much for these recommendations. I am very familiar with computer programming and will check these out.
Post reply on HN