
A new edition of a book, written in a humorous question-and-answer style, that shows how to implement and use an elegant little programming language for logic programming. The goal of this book is to show the beauty and elegance of relational programming, which captures the essence of logic programming. The book shows how to implement a relational programming language in Scheme, or in any other functional language, and demonstrates the remarkable flexibility of the resulting relational programs. As in the first edition, the pedagogical method is a series of questions and answers, which proceed with the characteristic humor that marked The Little Schemer and The Seasoned Schemer. Familiarity with a functional language or with the first five chapters of The Little Schemer is assumed. For this second edition, the authors have greatly simplified the programming language used in the book, as well as the implementation of the language. In addition to revising the text extensively, and simplifying and revising the “Laws” and “Commandments,” they have added explicit “Translation” rules to ease translation of Scheme functions into relations.
https://en.wikipedia.org/wiki/MiniKanren
There's a great book in the same series as the "Little Lisper"/"Little Schemer" books called "The Reasoned Schemer" that uses MiniKanren with Scheme.
The style of the Little/Seasoned/Reasoned Schemer is a little different from the other books I highlighted here, but various people have said they really like it, including Guy Steele, so they may be worth a look if the others don't really work for you.
*: <https://mitp-content-server.mit.edu/books/content/sectbyfn/b...>
**: <https://gustavus.edu/academics/departments/mathematics-compu...>
I'll throw out a recommendation for The Little series of books (e.g., The Little Schemer, The Seasoned Schemer, The Reasoned Schemer, The Little Typer, etc.)
The first book is all you need to grok recursion. You can just toss a copy at any student who struggles with it.
The second book ends with some really non-trivial CS stuff.
They're fantastic examples of the power of good pedagogy to explain interesting and difficult concepts normally relegated to drier texts.
Essentially, this book teaches Declarative Programming in the form of Relational Programming, using miniKanren.
Relational Programming is very much different from the usual forms of programming, and, IMO, worth knowing in order to expand your horizons, esp. if you are interested in Architecting software.
The group meets once a week on Zoom and chit-chats on Slack in the interim.
The next Zoom meeting is on Thursday Feb. 23, 7pm EST. Contact me for an invite.