This is a read-only archive!

PAIP review

It's been a while since I acquired PAIP. I can't say I've read all of it over the past couple months, but I've read most of it.

The initial chapters that give an intro to Common Lisp seem largely useless to me. There are better books to introduce Common Lisp (especially now that we have PCL). Norvig admits as much himself, and thankfully doesn't devote much of the book to intro material.

Once you get past those, this book is densely packed with information. Just tracing through and understanding the source code would probably take me a couple of months, let alone grasping all the concepts the source code is trying to exemplify. It's a wonder to me that one person can produce this much material. But the downside is that it's a bit difficult to read at times; it's kind of dry and reads like a text book. In spite of that, I was glued to this book for quite some time; the information inside is engaging enough to make up for the lack of presentation.

Some of the examples of code in the book really are quite startling. For example Norvig writes a pattern-matcher that implements some subset of Perlish regular expressions, and it only takes a couple pages of code. Later in another couple pages of code, he implements a variant of Prolog. At one point he writes some pattern-matchers that can parse a surprisingly large subset of the English language. But a lot of other examples of code weren't quite so interesting to me personally; a lot of the material is dedicated to tree and graph search algorithms, which brought to mind long boring lectures from my college days. (As a side note, it's very sad how much of the history of AI can be reduced to "clever graph search algorithms". I don't know much about AI today but I hope it's advanced a bit past that.)

This book is from 1992 and some of it does feel a bit dated. This book was apparently written just after Common Lisp was standardized. Object oriented programming was apparently relatively new back then, and Norvig glosses over CLOS. Most of the code is written in functional style. However Common Lisp today still doesn't force OO on you by any means, and a lot of Lispers today apparently still don't care much for OO, so the code is more relevant than you'd imagine.

And as you can't help realizing after reading an old CS book or two, CS as a science hasn't seen all that many breakthroughs in the short couple of decades it's been around. It's really quite sad in a way that a book written over 15 years ago can still be so relevant; we have all these huge advances in computer hardware, yet it still feels like we're in the Stone Age of computer programming.

Not being an Artifical Intelligence person myself, I can't judge how well this book serves as a guide to AI. But Norvig's stated goal was in large part to show the history of AI, and he does that very well. (This was history back in 1992 when the book was written, so it's even older now, but still interesting.) He walks through implementing a lot of famous AI programs from the past, and explains their limitations and how they can be improved. Want to write ELISA or other chat-bots? He does that. Want to write an Othello-playing program? He does that too.

One of the best things about this book is that Norvig's code is just about the Lispiest code I've seen. He does many things that take full advantage of all the nooks and crannies of Common Lisp and wouldn't make much sense in other languages. This is a good book to help you think in Lisp.

So I recommend this book. Though I'm unsure I'll ever manage to absorb most of the information in it.

March 10, 2008 @ 10:21 AM PDT
Cateogory: Book Reviews
Tags: PCL, Lisp, PAIP, Books

3 Comments

Ivar Refsdal
Quoth Ivar Refsdal on March 15, 2008 @ 12:19 AM PDT

Well, I've only read a bit of PAIP, but my main lesson so far was this: "Use the most natural notation available to solve a problem." (Then worry about writing an interpreter for that syntax later.) Comparing that to the (relatively few) programming books I've read, none of them has come close to saying anything like this, or guiding me in this direction, though this small insight has been extremely beneficial for me. (SICP is less clear with "wishful thinking".) Norvig also says something along the lines of that the reader should be able understand and "come up" with the material presented on his own, or feel it's natural. Sorry for the horrible English, but I hope you get what I mean. Essentially it's "clever common sense", things should be understandable. "Though I'm unsure I'll ever manage to absorb most of the information in it." Maybe you just need to give it more time?

"a lot of the material is dedicated to tree and graph search algorithms, which brought to mind long boring lectures from my college days." Well, I thought that was boring too and I did a sloppy job in last semester's algorithm course. But now I'm beginning to think it's actually very relevant for a probably a large number of cases. For example if I'm trying to write a compiler and want to have somewhat efficient CPU register usage, I have no idea where to begin. But your article made me think of graphs, thanks.

Norvig has a retrospect here: http://www.norvig.com/Lisp-retro.html

Ivar Refsdal
Quoth Ivar Refsdal on March 22, 2008 @ 1:17 AM PDT

Maybe you just need to give it more time? Just to add on this, I was somewhat shocked that you got through the first four chapters in just two days in your first PAIP post. That would have been way over my head, as (for me) there were quite a bit of new concepts that needed time to sink in. Maybe I'm just a slow learner.

There's also Successful Lisp as a companion to PCL. Looks pretty neat and very to the point.

Brian
Quoth Brian on March 22, 2008 @ 9:51 AM PDT

Maybe I didn't let the concepts sink in. I'll have to look at Successful Lisp when I have free time again someday.