Let Over Lambda by Doug Hoyte -- my favorite Lisp Book

This book has changed my brain. I cannot express how much joy I received from it.

To be fair, you should work through 'On Lisp' by Paul Graham, as structurally Let Over Lambda starts with concepts where Graham left of and takes them to outer space.

https://letoverlambda.com/index.cl/toc

Available as a paperback-on-demand by author, or if you need a digital backup, look on Anna's archive.

Posted in: s/Lisp

๐Ÿš€ stack

2025-01-19 ยท 1 year ago ยท ๐Ÿ‘ clseibold, argenkiwi

14 Comments โ†“

๐Ÿš€ stack [OP] ยท 2025-01-19 at 20:07:

Yes, @HanzBrix. I couldn't remember who asked and couldn't find your message. I also screwd up my dns resolver on my main machine, so I just posted to the feed. I hope it helps.

๐Ÿš€ clseibold [๐Ÿ›‚] ยท 2025-01-19 at 21:20:

@HanzBrix If you're looking into programming languages to learn, I highly recommend Odin, and it's got a new book! It's, imo, the closest, of all the newer languages, to C.

โ€” Understanding the Odin Programming Language

For something *really* out there, Rust makes its book available for free online, which is always cool.

๐Ÿš€ stack [OP] ยท 2025-01-19 at 21:40:

Keep in mind that Let Over Lambda is not your average Lisp book... It is a Lisp power user hacker's book, and many Lisp coders would never use what's in it, and call it and you crazy.

It's kind of like hardcore vim users say that you don't need any plugins, because a combination of some obscure commands kind of does the job.

The book shows, for instance, how to use closures to implement an object system in a dozen lines of lisp, something a Lisper would not do because CL has two elaborate object systems built in, one much better than anything in any Object-oriented language...

So it's more of a book about how far beyond expected or even reasonable you can push Lisp macros.

For practical coding, On Lisp is a pretty good overview of CL, and Common Lisp Recipes provides 600 pages of how to do a variety of things from reading a text file to making an elaborate package for distribution.

๐Ÿš€ stack [OP] ยท 2025-01-19 at 21:55:

To give you a sense of the book's flavor, consider the quine intoduced in the chapter on the reader:

This is what it says about hygienic macros and unwanted variable capture:

The current popular solution is to use so-called hygienic macros(11). These solutions try to limit or eliminate the impact of unwanted variable capture but unfortunately do so at the expense of wanted, desirable variable capture. Almost all approaches taken to reducing the impact of variable capture serve only to reduce what you can do with defmacro. Hygienic macros are, in the best of situations, a beginner's safety guard-rail; in the worst of situations they form an electric fence, trapping their victims in a sanitised, capture-safe prison. Furthermore, recent research has shown that hygienic macro systems like those specified by various Scheme revisions can still be vulnerable to many interesting capture problems

I love the playful, screw-the-authority style of this book.

I feel like I wrote this book on bizzaro.

Copying the quine above messed up the backquotes/quotes

๐Ÿš€ stack [OP] ยท 2025-01-19 at 22:16:

Having said all I've said previously, I have to add that this book is a blast even if you don't understand most of it.

First time I read it, I fell in love with it, because I didn't understand most of it, but it seemed like magic -- like nothing I've seen computer languages do. And it answered a lot of questions I had as a Lisp newbie, including why CL is orders of magnitude better than Scheme, and what macros are really about. By the time I finished skimming through it, I was in -- I would become a Lisp programmer!

A few years later, I went through the book page by page, working through the examples (which are also on github, btw). I modified and added a dozen macros from the book to my personal code library, and have used them extensively. I still don't claim to understand some of the more obscure parts.

And although he had me at the first chapter, at the end, Doug Hoyle implements a Forth in Lisp macros, and shows how to implement Lisp in that Forth...

๐Ÿš€ stack [OP] ยท 2025-01-19 at 23:10:

@HanzBrix -- in that case, enjoy the ride.

You may also be interested in Mezzano, a Common Lisp - based OS written from scratch (including a CL compiler inside). It actually runs in a VM (possibly on some hardware), and everything including a desktop-style GUI is in CL!

@clseibold, no offense, but you are peddling McDonalds in a world-class french kitchen here!

Although Odin may not be a bad choice as it is a systems language. If you are in the camp that thinks C needs to be replaced because it's old, with something shiny and new.

๐Ÿš€ clseibold [๐Ÿ›‚] ยท 2025-01-19 at 23:17:

@stack Compared to Lisp? lmao, that's the funniest statement if I've ever heard one. Lisp is cool and all, it's not what real programs made outside research facilities to be used by real people use when you care about efficiency on modern CPUs, or anything other than finding a parentheses in a parentheses-stack. Lisp-machines don't exist anymore, actual multi-user systems made in procedural languages, like C, replaced them. Sorry to burst your bubble!

๐Ÿš€ clseibold [๐Ÿ›‚] ยท 2025-01-19 at 23:23:

@stack Also, french kitchens are overrated. So boring. I'd rather have the vast different kinds of food I can get traveling to places I've never been - korea, southern US, Africa, Middle East, Mexico. European food was practically built off of the herbs, spices, and sugar that came from the east. While the food of the Middle East may be new to me, it's much older than French kitchens.

In all seriousness, C doesn't need to be replaced "because it's old", it needs to be replaced because it's literal crap. It's literal crap because it was made in a time when the parser had to be one-pass on what would now be considered potato machines that couldn't print any output to save paper and ink on teletype machines. You think all of C's choices were solely deliberate design decisions? LMAO. I can't breathe I'm laughing so much.

At least I don't use languages to be "cool" or countercultural for no legitimate reason. Languages are a tool, and I happen to find that Odin, Golang, and Rust suit the majority of use-cases in programming for users. Everything else is either specialized or different for difference's sake.

If I were really a mainstream trendy person, I would be using only Rust, Javascript, and Python right now. If I were really a countercultural bah humbug, I would be using only Odin, Zig, C, Pascal, and Simula. And If I were really a "I'm more intelligent than everyone else" person, I would be using Perl, Haskell, ObjectiveC, assembly, and cobol.

๐Ÿš€ stack [OP] ยท 2025-01-19 at 23:32:

@clseibold -- you are completely wrong! What you are saying here, in the Lisp area, shows a total ignorance of Lisp!

Lisp machines were replaced by commodity hardware and amazing modern compilers -- which are used as research platforms for compilers of other languages.

Features of Lisp are implemented one by one in other languages, because Lisp actually works! It was all done back in the 70's and the 80s, and the world is still catching up.

Lisp can be faster than C if you care to optimize it a bit. There is a regular-expression parser written in Lisp that searches expressions faster than anything else.

There are dozens of compliant open-source and propriatary Common Lisp compilers.

Lisp is used all over the place -- from the airline reservation systems to quantum computer simulators and trading systems and vacuum cleaners.

It is a secret weapon that companies don't talk about too much, because it gives them an amazing advantage over competition.

๐Ÿš€ stack [OP] ยท 2025-01-19 at 23:51:

@clseibold, I will ask you to show a little bit of respect. Both C and Lisp have a large user base, and just because you like slices (which can easily be implemented in either), does not mean that everything else is 'crap'.

Let us try to stay on topic and not troll each other!

๐Ÿฆ‹ CarloMonte ยท 2025-01-21 at 08:29:

If "Let over Lambda" is mentioned here, than please add "The Art of Prolog" by Sterling and Shapiro. This is another mind-blowing approach to programming and together with LISP, C and something OO you have a pretty complete collection. The book is of course dated and out of print and in high demand = expensive.

๐Ÿš€ stack [OP] ยท 2025-01-21 at 14:22:

Actually CL has the best object system, CLOS. It has multiple inheritance, generics, and can actually alter object composition and all live objects while executing code. Nothing comes close to CLOS.

That is why it's laughable when people say that Lisp sucks or that Rust or some other 2-year-old language is 'better'. Can you connect to a running application over SSH and recompile a single function or update your object schema? Or change the entire syntax of the language? It's not just baked into CL, it is structurally what Lisp is all about.

Prolog is definitely interesting, and there are some good implementations as Lisp DSLs. I think there is an implementation in Let Over Lamda.

๐Ÿš€ stack [OP] ยท 2025-01-21 at 16:21:

Still fuming...

Speaking of 'too specialized' languages, there is nothing more openminded than CL. You can easily use it as a functional language if you choose to do so. It has the best object model for OOP people. It has a serious type system, which is invisible (inferred types) unless you feel like declaring and enforcing types. Or just write code however you feel like.

You can compile it or interpret it. You can take it as high or as low as you want, use it as an assembler or create meta-languages and DSL. It can parse itself. The macro system is Lisp itself. You can cons up code. You can adjust or replace its syntax. You can batch- compile files or use a REPL to individually compile functions.

You can even save your working image, and move it to another machine.

The only thing that surpasses Lisp is people's ignorance.

๐Ÿฆ‹ CarloMonte ยท 2025-01-21 at 16:35:

As Prolog-like languages written in LISP go, probably mini-Kanren ist the most interesting.