top | item 45037419

Lisp from Nothing, Second Edition

372 points| nils-m-holm | 6 months ago |t3x.org

104 comments

order
[+] vkazanov|6 months ago|reply
As somebody who read a couple of the author's books, and also somebody who spent almost a decade studying compilers, I am genuinely curious about the author himself.

These works are something I both understand and would never achieve myself. These are cultural artifacts, like deeply personal poetry, made purely for the process of it. Not practically useful, not state of the art, not research level, but... a personal journey?

If the author is reading this... can you share your vision? Motivation?

[+] nils-m-holm|6 months ago|reply
Thank you so much for reading my books and describing my work in such beautiful words! You basically answered your own question! My motivation is just the creation of something I find beautiful. The vision, to pass knowledge to those who seek it in the simplest possible way, where "simple" does not necessarily mean in the tersest form, but in a form that invites being digested.

I do not usually talk much about "myself". I tried, but with no-one asking, I find it difficult to say anything.

[+] marttt|6 months ago|reply
+1, long time follower of nmh's work. His books are brief and concise, but carry a peculiar "something", a precision of expression etc that is hard to put into words - but can often be noticed in long-time practicioners of some mental teaching. :)

It is always interesting to spot a person on the interwebs who seems to actually have managed to turn buddhist or some other teachings into real world deeds. Living really modestly (IIRC, he/you also uses modest, underclocked laptops?), publishing for the benefit of many, and doing all this for years and years. Like, there seems to be no "overhead" in this way of living. Hugely inspirational.

I would also point out the "Essays" section on nmh's webpage, especially the ones discussing sensitivity and high IQ: https://t3x.org/#essays

Having purchased several of your books, thanks for your work, nmh!

[+] nils-m-holm|6 months ago|reply
Many thanks to everybody who is wrote in this thread! Your words mean a lot to me! I will reply to some individual messages. If I don't, please substitute "thank you!" :)
[+] AlexeyBrin|6 months ago|reply
I second this, would be great if someone did a long form video interview with the author.
[+] matheusmoreira|6 months ago|reply
> These are cultural artifacts, like deeply personal poetry, made purely for the process of it. Not practically useful, not state of the art, not research level, but... a personal journey?

I can't speak for the author but this is exactly how I look at the lisp I'm developing. It's a lifetime project. I had some kind of vision depicting how different things could be, and at some point I started trying to make it happen. I want to convince myself I'm not insane for thinking it was possible in the first place.

[+] bakul|6 months ago|reply
Read the author’s “Raja Yoga Revisited”.
[+] uncircle|6 months ago|reply
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

[+] tromp|6 months ago|reply
Looking at file church.scm from the provided zip file [1], I see the following functions used to construct lists:

    (define kons
      (lambda (x) (lambda (y) ((pair false) ((pair false) ((pair x) y))))))
    
    (define kar   (lambda (x) (first (second (second x)))))
    (define kdr   (lambda (x) (second (second (second x)))))
    
    (define nil   ((pair true) ((pair true) false)))
    (define null  first)
    
    (define atom  (lambda (x) (first (second x))))
That's 2 extra booleans per list element. While the one for recognizing atoms is probably necessary, the other one for recognizing nil is not:

    (define kons
      (lambda (x) (lambda (y) ((pair false) ((pair x) y)))))
    
    (define kar   (lambda (x) (first (second x))))
    (define kdr   (lambda (x) (second (second x))))
    
    (define nil ((pair true) false))
    (define null (lambda (x) (((second x) (lambda (a) (lambda (d) (lambda (z) false)))) true)))
    
    (define atom  (lambda (x) (first x)))
The use of null+car+cdr can usually be avoided by using a matching construct instead like

    (((second list) (lambda (a) (lambda (d) (lambda (z) deal_with_car_a_and_cdr_d ) deal_with_nil)
[1] https://t3x.org/lfn/church.zip
[+] nils-m-holm|6 months ago|reply
But then (ATOM NIL) is neither TRUE nor FALSE.
[+] mindcrime|6 months ago|reply
Looks awesome. Just ordered a copy. I'm just now picking up Peter Seibel's Practical Common Lisp again and taking another stab at immersing myself in the world of Lisp. So this is perhaps fortuitous timing.
[+] C-x_C-f|6 months ago|reply
I love Lisp (I'm an Emacs user and often write in Racket for personal projects) but the one thing I never understood about the Lisp community is the emphasis placed on metacircular evaluators.

I sure find them beautiful and all, but why do they take center stage so often? Beside the aesthetics and instructional value, I don't get the appeal. Also I feel that a bunch of the heavy lifting behind metacircular evaluators is actually done by the Polish notation syntax as well as the actual implementation, and these concepts don't get nearly as much love.

Any Lisper who can illuminate me?

[+] Quitschquat|6 months ago|reply
Long time lisper. It just doesn’t feel right unless your language can compile your language. It’s like wearing someone else’s underwear.
[+] rootnod3|6 months ago|reply
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.

[+] wkjagt|6 months ago|reply
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.
[+] nils-m-holm|6 months ago|reply
Second edition, with a new chapter on lambda calculus.
[+] gritzko|6 months ago|reply
Thanks. I recently had to reinvent LISP to script my CRDT database. That was not much work, because I already had the notation (I use RDX, a JSON superset with CRDT types). Still, I stumbled at the idiosyncratic LISP bracketing. Luckily, RDX allows for different tuple notations. So, I styled it to look less alien to a curly-braced developer. Like this https://github.com/gritzko/go-rdx/blob/main/test/13-getput.j...

For example, print change-dir make-dir; is equivalent to (print (change-dir (make-dir) ) ) in the old money. I wonder if I am reinventing too much here.

Did LISPers try to get rid of the brackets in the past?

[+] wooby|6 months ago|reply
The book looks awesome. However, I find some irony in the presence of a “no AI” badge on the back cover considering Lisp was AI research.
[+] Fraterkes|6 months ago|reply
Has anyone here read his “Practical Compiler Construction”? It’s on of the shorter compiler books Ive seen, seems like it might be a good way to learn a bit more about assembly
[+] shoobiedoo|6 months ago|reply
I was very curious about this too. I've had my finger hovering over the "buy" button for months but there are next to no reviews on it. I'm wondering how it differs from other, similar works
[+] AnonC|6 months ago|reply
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?

[+] leoc|6 months ago|reply
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.
[+] chrsw|6 months ago|reply
There's ANSI Common Lisp by Paul Graham. I've never read it and I'm not sure it's the best introduction but thumbing through it I don't see how you can get any more basic than that.
[+] epr|6 months ago|reply
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

[+] m-a-t-t-i|6 months ago|reply
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.

[+] Jach|6 months ago|reply
One source of awe people have with the idea of Lisp is how much you can build off of so little. I like pg's Roots of Lisp paper on that https://justine.lol/sectorlisp/jmc.pdf The core thing was the meta-circular evaluator (eval) in the original Lisp paper. You can work through it or try re-implementing it in something else. I like this recent tiny version https://justine.lol/sectorlisp2/

Another source of awe is about Lisp being more of a programming system than a language, and Common Lisp was the standardization of a lot of efforts towards that by companies making large and industrial pieces of software like operating systems, word processors, and 3D graphics editors. At the language level, "compile", "compile-file", "disassemble", "trace", "break", "step" are all functions or macros available at runtime. When errors happen, if there's not an explicit handler for it (like an exception handler) then the default behavior isn't to crash but to trigger the built-in debugger. And the stack isn't unwound yet, you can inspect the local variables at every layer. (There's very good introspection in general for everything.) Various restarts will be offered at different parts of the stack -- for example, a value was unknown, so enter it now and continue. Or you can recompile your erroneous function and restart execution at one of the stack frames with the original arguments to try again. Or you can apt-get install some foreign dependency and try reloading it without having to redo any of the effort the program had already made along the way.

Again, all part of the language at runtime, not a suite of separate tools. Implementations may offer things beyond this too, like SBCL's code coverage or profiling features. All the features of the language are designed with this interactivity and redefinability in mind though -- if you redefine a class definition, existing objects will be updated, but you can control that more finely if you need to by first making a new update-instance-for-redefined-class method. (Methods aren't owned by classes, unlike other OOP languages, which I think eliminates a lot of the OOP design problems associated with those other languages.)

I like the book Successful Lisp as a tour of Common Lisp, it's got a suggested reading order in ch 2 for different skill levels: https://dept-info.labri.fr/~strandh/Teaching/MTP/Common/Davi... It's dated in parts as far as tooling goes but if you're mostly interested in reading about some bits rather than actively getting into programming with Lisp that's not so bad. If you do want to get into it, https://lispcookbook.github.io/cl-cookbook/ has some resources on getting started with a Lisp implementation and text editor (doesn't have to be emacs).

[+] globular-toast|6 months ago|reply
Can anyone compare this with Queinnec's Lisp in Small Pieces? I was waiting for an English version of the 2nd edition but I guess it's never happening and my French has unfortunately regressed since then.
[+] nils-m-holm|6 months ago|reply
LISP in Small Pieces discusses very sophisticated techniques, while LISP From Nothing is more about the quirks and implementations of early LISP. Of course you can write a modern LISP based on the things covered in LFN, but if you are planning to write more than a toy, then Queinnec's book is the one to read.
[+] hermitcrab|6 months ago|reply
The title "Lisp from nothing"

doesn't seem to fit with:

"INTENDED AUDIENCE This is not an introduction to LISP."

on page 10.

[+] gentooflux|6 months ago|reply
Nothing as in "from scratch", as opposed to Nothing as in "Visual Basic's NULL".
[+] user3939382|6 months ago|reply
Did you guys hear Ladybird is gonna be ClojureScript by default /dream
[+] nils-m-holm|6 months ago|reply
tug2024 wrote: > Doesn’t lisp extend lambda calculus (abstraction . application)? As a consequence, lisp (abstraction . application . environment)!

Another valid question downvoted into oblivion.

The environment in (lexically scoped) LISP is an implementation detail. Lambda calculus does not need an environment, because variables are substituted on a sheet of paper. So lambda calculus equals lexically scoped LAMBDA in LISP.

Sure, you could view LISP as LC plus some extra functions (that are not easily implemented in LC).

[+] neonrider|6 months ago|reply
A hacker and a mystic. We need more of those.
[+] fermigier|6 months ago|reply
"... and the chicks for free "?
[+] aidenn0|6 months ago|reply
I have listened to that song probably 100s of times and always heard "checks," so I just learned something new about that song. Thanks.

Maybe less embarrassing than talking about Rock the Cashbar by The Clash (though that one was corrected the first time I saw the back of the album).

[+] nils-m-holm|6 months ago|reply
Haha, yes! You are the first one to notice or, at least, to respond.
[+] rootnod3|6 months ago|reply
Damn. I ordered the first edition a few weeks back and now the second edition is out :D
[+] nils-m-holm|6 months ago|reply
Aww, man. If you haven't yet purchased the 2nd ed, send me an email!