HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
norvig
paip-lisp
Common Lisp2018–2026
norvig / paip-lisp

paip-lisp

Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

63Distinct people
102Mentions
6Explicit recommenders
7.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

This is the Logic Theorist: https://en.wikipedia.org/wiki/Logic_Theorist I love Simon's anecdote of using his wife and children as the stack as he developed IPS. This…

kjander79 used a recommendation phrase. 6 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 6:28:55 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year102 dated mentions

Observed mentions: 2018-02-26 21:33:21 UTC to 2026-04-19 12:10:13 UTC.

051015202018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 11 mentions; 3 submissions, 8 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 14 mentions; 3 submissions, 11 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 11 mentions; 1 submissions, 10 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 15 mentions; 0 submissions, 15 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 15 mentions; 2 submissions, 13 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 19 mentions; 1 submissions, 18 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC1138
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC14311
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC11110
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC15015
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC15213
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC707
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC19118
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC808
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 12, 2026.

Read the project’s introduction
This is an open-source repository for the book Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp by Peter Norvig (1992), and the code contained therein. The copyright has reverted to the author, who has shared it here under MIT license. On the list of most influential books for programmers. As seen on TV. See also: errata, comments, retrospective. The book is available in these formats: we're generating ebooks - epub and pdf - from the markdown files, see Releases scanned pdfs 4th edition, 1998: higher resolution, better OCR, smaller file thanks to better compression 6th edition, 2001: newer printing text: PAIP.txt (from OCR'ing the scanned pdf, containing many errors) a source epub: see releases for a cleaned up version downloaded from Safari (much cleaner than the scanned versions) and chapter?.md markdown files: Table of Contents Paradigms of Artificial Intelligence Programming Front matter Preface Part I: Introduction to Common Lisp 1 Introduction to Lisp 2 A Simple Lisp Program 3 Overview of Lisp Part II: Early AI Programs 4 GPS: The General problem Solver 5 Eliza: Dialog with a Machine 6 Building Software Tools 7 Student: Solving Algebra Word Problems 8 Symbolic Mathematics: A Simplification Program Part III: Tools and Techniques 9 Efficiency Issues 10 Low-Level Efficiency Issues 11 Logic Programming 12 Compiling Logic programs 13 Object-Oriented Programming 14 Knowledge Representation and Reasoning Part IV: Advanced AI Programs 15 Symbolic Mathematics with Canonical Forms 16 Expert Systems 17 Line-Diagram Labeling by Constraint Satisfaction 18 Search and the Game of Othello 19 Introduction to Natural Language 20 Unification Grammars 21 A Grammar of English Part V: The Rest of Lisp 22 Scheme: An Uncommon Lisp 23 Compiling Lisp 24 ANSI Common Lisp 25 Troubleshooting The Lisp Files The Lisp code files are listed here: CH Filename Description - examples.lisp A list of example inputs taken from the book - tutor.lisp An interpreter for running the examples - auxfns.lisp Auxiliary functions; load this before anything else 1 intro.lisp A few simple definitions 2 simple.lisp Random sentence generator (two versions) 3 overview.lisp 14 versions of LENGTH and other examples 4 gps1.lisp Simple version of General Problem Solver 4 gps.lisp Final version of General Problem Solver 5 eliza1.lisp Basic version of Eliza program 5 eliza.lisp Eliza with more rules; different reader 6 patmatch.lisp Pattern Matching Utility 6 eliza-pm.lisp Version of Eliza using utilities 6 search.lisp Search Utility 6 gps-srch.lisp Version of GPS using the search utility 7 student.lisp The Student Program 8 macsyma.lisp The Macsyma Program 8 macsymar.lisp Simplification and integration rules for Macsyma 9-10 auxfns.lisp Auxiliary functions 11 unify.lisp Unification functions 11 prolog1.lisp First version of Prolog interpreter 11 prolog.lisp Final version of Prolog interpreter 12 prologc1.lisp First version of Prolog compiler 12 prologc2.lisp Second version of Prolog compiler 12 prologc.lisp Final version of Prolog compiler 12 prologcp.lisp Primitives for Prolog compiler 13 clos.lisp Some object-oriented and CLOS code 14 krep1.lisp Knowledge Representation code: first version 14 krep2.lisp Knowledge Representation code with conjunctions 14 krep.lisp Final KR code: worlds and attached functions 15 cmacsyma.lisp Efficient Macsyma with canonical form 16 mycin.lisp The Emycin expert system shell 16 mycin-r.lisp Some rules for a medical application of emycin 17 waltz.lisp A Line-Labeling program using the Waltz algorithm 18 othello.lisp The Othello playing program and some strategies 18 othello2.lisp Additional strategies for Othello 18 edge-tab.lisp Edge table for Iago strategy 19 syntax1.lisp Syntactic Parser 19 syntax2.lisp Syntactic Parser with semantics 19 syntax3.lisp Syntactic Parser with semantics and preferences 20 unifgram.lisp Unification Parser 21 grammar.lisp Comprehensive grammar of English 21 lexicon.lisp Sample Lexicon of English 22 interp1.lisp Scheme interpreter, including version with macros 22 interp2.lisp A tail recursive Scheme interpreter 22 interp3.lisp A Scheme interpreter that handles call/cc 23 compile1.lisp Simple Scheme compiler 23 compile2.lisp Compiler with tail recursion and primitives 23 compile3.lisp Compiler with peephole optimizer 23 compopt.lisp Peephole optimizers for compile3.lisp Running the Code There is no single "application" to run. Rather, there is a collection of source code files, duplicating the code in the book. You can read and/or run whatever you like. Lisp is an interactive language, and you will need to interact with the code to get benefit from it. Some hints: You will need a Common Lisp interpreter/compiler/environment. Here's a discussion of the options. You will always need (load "auxfns.lisp"). You will need (requires "file"), for the various instances of file that you want to use. (If requires does not work properly on your system you may have to alter its definition, in auxfns.lisp. The function do-examples, which takes as an argument either :all or a chapter number or a list of chapter numbers, can be used to see examples of the use of various functions. For example, (do-examples 1) shows the examples from chapter 1. Access this by doing (requires "examples"). Other resources I wrote a retrospective on the book in 2002. There is a nice Python version of the code, by Daniel Connelly at Georgia Tech, supervised by Ashok Goel.
Read the full README on GitHub

What Hacker News says

11 sources
Well, I have a cynical take about the unique appeal of Common Lisp, but even cynicism aside Common Lisp is not going to lose to Racket in the "interesting companies" department, I think. Google Flights is still powered by Common Lisp. Clasp is somewhat interesting (and there is a Google Tech Talk about it, too). And instead of learning "How to Design Programs" from people with unclear experience in designing interesting programs, you can read a book full of small interesting programs written by someone with pretty clear track record of doing interesting things (https://github.com/norvig/paip-lisp).
In State of Common Lisp Survey 2020
MAL - Make a Lisp [0]. This one has been discussed on HN before - its where I found it. I completed it last year (from Jan to May 2019) and ended up with Lisp-a-like interpreter written in C# that is sophisticated enough to self-host (i.e. it can interpret and run itself). I picked it up again when the lockdown started and I am now using it to re-implement some of the classic AI systems described in Paradigms of AI Programming [1]. I almost have Eliza (the first chatbot, from 1966!) running, which has necessitated some thinking because MAL is closer to Clojure than the Common Lisp used in PAIP. I'm also implementing what is in effect a standard library of useful MAL functions. What I got from MAL was much better knowledge of C#, better insights into the power of lisp-like languages, some intense satisfaction when I managed some of the mor
Read the rest
e complex stages, etc. MAL is progressive, supported by 100s of tests, and an amazing array of reference implementations in a huge number of different programming languages. [Edit] My side-project before MAL involved downloading the Unity game engine and using it to explore the different aspects of game development. I discovered that I really enjoyed asset creation and in particular lighting and shader design, and (long story short - totally bizarre trajectory) ended up creating a tutorial for the Octane render engine that has had actual sales! If I was going to look at games again I'd probably start with a simpler engine such as Godot [2] [0] https://github.com/kanaka/mal/blob/master/process/guide.md [1] https://github.com/norvig/paip-lisp [2] https://godotengine.org/
In Ask HN: Looking for side project ideas
Not OP, but Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside. Mutation is common, don’t think Lisp will be a language like Haskell. For resources, I would recommend Practical Common Lisp[0] and PAIP[1]. For some modern development practices, the Common Lisp Cookbook[2] is great. [0]: http://www.gigamonkeys.com/book/ [1]: https://github.com/norvig/paip-lisp [2]: http://lispcookbook.github.io/cl-cookbook/
In I’ve Consed Every Pair
Tcepsa·Feb 18, 2020Recommendation phrase
Not saying there weren't false starts, but your example of eliminate() is actually a fairly common idiom[0] where, when a function is testing things for "truthiness" or "falsiness", it will return the truthy or falsey value rather than actual True or False. It lets code be more brief because you can do e.g. a check for null and perform assignment of either the value or a default in a single statement, so for example something like this: if( maybeNullValue ) { myValue = maybeNullValue; } else { myValue = defaultValue; } can instead be expressed as this: myValue = maybeNullValue || defaultValue; I'm personally a little bit torn about it. On the one hand, now that I'm familiar with it I love how much more concise code can be. On the other, it can have a fairly negative impact on code maintainability: if someone comes alo
Read the rest
ng who isn't familiar with that idiom, they might have a bad time trying to figure out what's going on (or worse, they might take offense that all these predicates aren't returning True or False values and rewrite the whole mess--or you could end up with a mix of the two, where some functions follow the idiomatic convention and others return actual boolean values which is arguably the worst) Also I'm not trying to say that there's not some YAGNI going on here--just that I suspect he did it that way somewhat reflexively, and that in that particular case we probably cannot infer he had originally intended to do something else with those results and then changed his mind later. [0] at least in the Lisp world, which Norvig has extensive experience with[1] [1] https://github.com/norvig/paip-lisp
In The Myth of the Myth of the 10x Programmer
armitron·Jan 16, 2020Recommendation phrase
On Lisp is an advanced text about Lisp macros, not recommended as an introduction (but highly recommended if you've written Common Lisp). SICP is great but not really about Lisp. I recommend Norvig's PAIP [1] or Graham's ANSI Common Lisp [2]. Another book that's often recommended is Practical Common Lisp but I think it's dated and hasn't aged well. It's also nowhere near as mind expanding as PAIP/Graham's books. [1] https://github.com/norvig/paip-lisp [2] PDFs can be found on Google Clojure is not recommended as it is very different to Lisp. Lisp code needs to be entirely rewritten before it will run on Clojure. That is not true for Common Lisp, Emacs Lisp and even Scheme.
In The Roots of Lisp (2001)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.