The Reasoned Schemer Summary and Reviews

The Reasoned Schemer
by William E. Byrd, Daniel P. Friedman, Oleg Kiselyov

The Reasoned Schemer
List Price: $29.00
Our Price: $24.02
You Save: $4.98 (17%)
Availability: Usually ships in 1-2 business days
Buy Used: from $18.00 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Daniel P. Friedman, Oleg Kiselyov, William E. Byrd
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2005-10-14
ISBN: 0262562146
Number of pages: 176
Publisher: The MIT Press

Book Reviews of The Reasoned Schemer

Book Review: Better go to the Source
Summary: 3 Stars

I guess this book is OK, but it could really be written in all of about 5 to 10 pages of text with half a page of implementation code - in Haskell.

Main idea: use (potentially) infinite lists to represent (potentially) infinite streams of solutions to a problem. Have "goals" as procedures that work on (partial) solutions, producing new lists (empty/singleton/plural) of (more complete) solutions for each solution processed. Have a mechanism of combining these solutions streams. Now AND is just a sequential combinator and goal applicator; OR is a sequential combinator for parallel application; OR/i (for interleaving) combines its result streams in an interleaving fashion.

It suffices to have these combinators binary, because any type of COND is anyhow broken down to these binary combinations, as in a typical COND rewrite with IFs - and that's what the book itself does too, in a somewhat complex Scheme macro syntax. Expressed in Haskell, the intent is clear and the meaning is immediately obvious:

Sequential stream combination ("mplus" of the book):
(1) [] ++: ys = ys
(2) (x:xs) ++: ys = x:(xs ++: ys)

Alternating stream combination ("mplus/i"):
(3) [] ++/ ys = ys
(4) (x:xs) ++/ ys = x:(ys ++/ xs)

Sequential feed ("bind"):
(5) [] >>: g = []
(6) (x:xs) >>: g = g x ++: (xs >>: g)

Alternating feed ("bind/i"):
(7) [] >>/ g = []
(8) (x:xs) >>/ g = g x ++/ (xs >>/ g)

"OR" goal combination ("cond/e"):
(9) (f ||: g) x = f x ++: g x

"Alternating OR" goal combination ("cond/i"):
(10) (f ||/ g) x = f x ++/ g x

"AND" goal combination ("all"):
(11) (f &&: g) x = f x >>: g

"Alternating AND" goal combination ("all/i" of the book):
(12) (f &&/ g) x = f x >>/ g

That's about all there is to it. If you're unfamiliar with Haskell, it's a type-inferencing, auto-currying LISP with unparenthesised syntax where "f x" stands for functional application, "[]" stands for empty list, "x:xs" for cons cell (x . xs), and parentheses are used for grouping of expressions. It is non-strict, so lazy lists are used throughout, and _everything_ is a delayed lambda, calculated on "as-needed" basis. Having finally produced a stream of solutions, we rely on Haskell to only calculate as much of it as is actually requested by a user (usually one by one, as in Prolog), thus in effect performing depth-first search of a problem space.

It should be clear now that the actual nature of our solutions should be regarded quite apart from the mechanism of producing, combining and managing these infinite streams. Unification can then be viewed as just another "knowledge-enhancing" goal capable of rejecting the solution it's supplied with, by producing an empty list, or updating it, by producing a new list containing an updated solution(s). These solutions can be of any type, whether built-in or user-defined native Haskell type, and not just general symbolic structure capable of representing a kind of symbolic terms Prolog has, which is what's done in the book - where everything is represented through this symbolic structure, even numbers.

Implementing arithmetical relations on top of that is a standard exercise in hopeless inefficiency. The book wants to add logic programming capabilities to the existing Scheme system. Surely we don't have to reinvent numbers for this, and in such an incredibly inefficient way at that!

Instead of reusing blind structural unification of Prolog, the authors could discuss how it can be seen as creating equality constraints, then proceed to implement _them_ thus having truly added the relational capabilities ON TOP of the existing Scheme system, with its numeric functions working for us directly, hopefully.

If this book had THAT, THEN it would have been a great book.

Alas, no. The authors decided instead to stay at a fairly rudimental level, and be very verbose and inexplicit at the same time. And here I come to a point about their whole methodology in this as in their other books of this series, of presenting their material by examples only, making it unnecessarily obscure for a reader. It seems to me they've gone to the other extreme here from the pseudo-scientific type of dry presentation full of abstruse terminology. The golden path, as always, may lie somewhere in the middle - first presenting the material through examples and just playing with it (like they do here), but then proceeding to more precise formulation and discussion of the issues.

This book is long on promise, but short on clarity and depth.

Languages & Tools Books

Book Subjects
Most talked about in Languages & Tools Books
Eclipse Plug-ins (3rd Edition) ImageEclipse Plug-ins (3rd Edition)
by Eric Clayberg, Dan Rubel
Addison-Wesley Professional; Published: 2008-12-21; Paperback; Book
Best price: $38.33
Price in other shops: $59.99
Java Software Solutions: Foundations of Program Design (6th Edition) ImageJava Software Solutions: Foundations of Program Design (6th Edition)
by John Lewis, William Loftus
Addison Wesley; Published: 2008-03-07; Paperback; Book
Best price: $74.40
Price in other shops: $128.00
C++ Primer (3rd Edition) ImageC++ Primer (3rd Edition)
by Stanley B. Lippman, Josée Lajoie
Addison-Wesley Professional; Published: 1998-04-02; Paperback; Book
Best price: $14.47
Price in other shops: $49.99
Accelerated C++: Practical Programming by Example ImageAccelerated C++: Practical Programming by Example
by Andrew Koenig, Barbara E. Moo
Addison-Wesley Professional; Published: 2000-08-24; Paperback; Book
Best price: $26.99
Price in other shops: $49.99
Patterns of Software: Tales from the Software Community ImagePatterns of Software: Tales from the Software Community
by Richard P. Gabriel
Oxford University Press, USA; Published: 1998-05-28; Paperback; Book
Best price: $64.55
Just Java? 2 (6th Edition) ImageJust Java? 2 (6th Edition)
by Peter van der Linden
Prentice Hall; Published: 2004-07-01; Paperback; Book
Best price: $35.00
Price in other shops: $64.99
UML for Java? Programmers ImageUML for Java? Programmers
by Robert C. Martin
Prentice Hall; Published: 2003-06-06; Paperback; Book
Best price: $22.99
Price in other shops: $44.99
Thinking in Java (3rd Edition) (One-Off) ImageThinking in Java (3rd Edition) (One-Off)
by Bruce Eckel
Prentice Hall PTR; Published: 2002-12-06; Paperback; Book
Best price: $13.80
Price in other shops: $54.99
SQL Fundamentals with CDROM ImageSQL Fundamentals with CDROM
by John J. Patrick
Prentice Hall; Published: 1999-05-11; Paperback; Book
Best price: $12.00
Price in other shops: $44.99
C How to Program, 2nd Edition ImageC How to Program, 2nd Edition
by Paul J. Deitel
Prentice Hall; Published: 1994-01-13; Textbook Binding; Book
Best price: $25.84
Price in other shops: $70.00
Similar books summaries and other product reviews
The Haskell Road to Logic, Maths and Programming (Texts in Computing) ImageThe Haskell Road to Logic, Maths and Programming (Texts in Computing)
by Kees Doets, van Jan Eijck
College Publications; Published: 2004-05-07; Paperback; Book
Best price: $22.29
Price in other shops: $25.00
The Joy of Clojure: Thinking the Clojure Way ImageThe Joy of Clojure: Thinking the Clojure Way
by Michael Fogus, Chris Houser
Manning Publications; Published: 2011-04-04; Paperback; Book
Best price: $23.84
Price in other shops: $44.99
Land of Lisp: Learn to Program in Lisp, One Game at a Time! ImageLand of Lisp: Learn to Program in Lisp, One Game at a Time!
by Conrad Barski
No Starch Press; Published: 2010-11-12; Paperback; Book
Best price: $26.39
Price in other shops: $49.95
An Introduction to Functional Programming Through Lambda Calculus (Dover Books on Mathematics) ImageAn Introduction to Functional Programming Through Lambda Calculus (Dover Books on Mathematics)
by Greg Michaelson
Dover Publications; Published: 2011-08-18; Paperback; Book
Best price: $15.17
Price in other shops: $24.95
The Art of the Metaobject Protocol ImageThe Art of the Metaobject Protocol
by Gregor Kiczales, Jim des Rivieres, Daniel G. Bobrow
The MIT Press; Published: 1991-07-30; Paperback; Book
Best price: $34.00
Price in other shops: $50.00
Let Over Lambda ImageLet Over Lambda
by Doug Hoyte
Lulu.com; Published: 2008-04-02; Paperback; Book
Best price: $35.81
Price in other shops: $39.95
The Scheme Programming Language ImageThe Scheme Programming Language
by R. Kent Dybvig
The MIT Press; Published: 2009-07-31; Paperback; Book
Best price: $27.00
Price in other shops: $45.00
Structure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science) ImageStructure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science)
by Harold Abelson, Gerald Jay Sussman
The MIT Press; Published: 1996-09-01; Paperback; Book
Best price: $33.74
Price in other shops: $46.00
The Seasoned Schemer ImageThe Seasoned Schemer
by Daniel P. Friedman, Matthias Felleisen
The MIT Press; Published: 1995-12-21; Paperback; Book
Best price: $19.96
Price in other shops: $28.00
The Little Schemer - 4th Edition ImageThe Little Schemer - 4th Edition
by Daniel P. Friedman, Matthias Felleisen
The MIT Press; Published: 1995-12-21; Paperback; Book
Best price: $20.87
Price in other shops: $29.00