Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Jump to ratings and reviews
Rate this book

Land of Lisp: Learn to Program in Lisp, One Game at a Time!

Rate this book
Lisp is a uniquely powerful programming language that, despite its academic reputation, is actually very practical. Land of Lisp brings the language into the real world, teaching Lisp by showing readers how to write several complete Lisp-based games, including a text adventure, an evolution simulation, and a robot battle. While building these games, readers learn the core concepts of Lisp programming, such as data types, recursion, input/output, object-oriented programming, and macros. And thanks to the power of Lisp, the code is short. Rather than bogging things down with reference information that is easily found online, Land of Lisp focuses on using Lisp for real programming. The book is filled with the author Conrad Barski's famous Lisp cartoons, featuring the Lisp alien and other zany characters.

504 pages, Paperback

First published November 2, 2010

Loading interface...
Loading interface...

About the author

Conrad Barski

5 books12 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
274 (41%)
4 stars
248 (37%)
3 stars
114 (17%)
2 stars
27 (4%)
1 star
1 (<1%)
Displaying 1 - 30 of 36 reviews
Profile Image for thirtytwobirds.
121 reviews56 followers
November 5, 2012
A great introduction to Lisp and a lot of other topics using games as example programs. The games are fun to create and the writing style is very readable, which keeps things interesting. If you take the time to go through and actually type out all the programs you'll learn a lot. This isn't a good book for someone who's never programmed before, but if you know how to code and want to learn what this Lisp thing is all about, this is your book.

Here are a few (minor) downsides:

* Sometimes the indentation of certain forms in the example code is weird. This is probably due to width restrictions. Without syntax highlighting you have to resort to counting parentheses to figure out what's going on, which is kind of annoying.

* The code at the end gets *really* hairy. I finally gave up at typing in the last chapter because there was a bug somewhere many levels down that I didn't feel like trying to track down. I suppose that's the price of having many complete games in such a short amount of code. I think I would have preferred maybe a different final game instead of hacking more and more crap into Dice of Doom, but that's just me.

* Read the errata (google for it) if you don't want to tear your hair out.
2 reviews2 followers
August 6, 2016
A far superior book to even the venerated tome, "Practical Common Lisp" (PCL). My advice to newbies would be to start off with Land of Lisp (LoL), finish all the non-game related stuff (well, maybe the games in the first few chapters are fine), move on to PCL, and then come back and finish the games in LoL. Also, the lazy library built in LoL is something not to be missed.
Profile Image for Minh Nhật.
89 reviews49 followers
October 30, 2018
đời gõ code của mình có 2 lựa chọn cảm thấy rất đúng cho tới giờ là mua mechkey filco và đọc cuốn Structure and Interpretation of Computer Programs(SICP) để mê đắm với Lisp và Scheme. Không phải đùa chứ mình hiểu được mấy thứ về material historicism như trải nghiệm từ việc dùng ngôn ngữ này :'(

2 Ấn tượng lớn nhất lisp là symbolic computaion và list processing.

1) symbolic computaion, code as data(homoiconic) làm cho chương trình có khả năng tự manipulate chính nó.
Có thể chia vấn đề mà các ngôn ngữ giải quyết theo 2 dạng, xử lý tính toán với số liệu cụ thể như hệ Fortran, C, ...(1) và xử lý biểu tượng(2).
Nhớ lại thời đi học ta học hay làm mấy bài rút gọn biểu thức, tính đạo phân tích các kiểu thì đó chính là symbolic manipulation, thuần túy toán học(2), để thể hiện 1 biểu thức toán học thì các ngôn ngữ khác chỉ có thể dùng string, còn lisp biểu diễn bằng 1 danh sách các biểu tượng nên xử lý nó rất dể.

Khi đã rút gọn xong rồi thì mới áp số vào để giải quyết từng bài toán cụ thể, thường là trong các ngành áp dụng như vật lý, hóa, sinh, ...(1)

Trong SICP có nguyên 1 ví dụ để về tính tích phân rất hay. Tác giả còn có nguyên 1 cuốn Structure and Interpretation of Classical Mechanics để áp dụng(trong SICP cũng có, và đây là ví dụ mình thích nhất)

Và nói tới lisp thì phải nói tời paper Recursive Functions of Symbolic Expressions and Their Computation by Machine của John McCarthy, cha đẻ của lisp và cũng là người đặt ra khái niệm Artificial Intelligence tại AI lab ở MIT. Và hiển nhiên là ổng dùng lisp để làm ai rồi, mà với sự nổi lên của deeplearning thì giờ đã thành good-old fashioned rồi :)).
(thông tin thêm, theo lời của Norvig thì gia đoạn AI boom 60s Ở mỹ rất khoái dùng lisp trong khi ở châu âu và nhật thì lại khoái dùng Prolog 1 ngôn ngữ lập trình logic, có điều kiện thì mình cũng thử cái này, hehe)

2) LISP là viết tắt của LISt Processing, 1 cấu trúc dữ liệu mà thể hiện data rất linh hoạt, vẫn còn nhiều chổ bất ngờ bởi tới mức ko thể tin được là sao 1 cấu trúc dữ liệu mà áp dụng được quá hay và sáng tạo tới thế(data abstraction). Ai ấn tượng với lambda calculus thì sẽ ấn tượng với dùng list trong lisp. Đây là điều thực tiễn nhất mà mình học được từ lisp.
Triết lý của lisp là tối thà ít data structure, mà xây dựng nhiều operator cho nó hơn là dùng nhiều data structure với nhiều operator. Minh họa thêm mấy rule của Rob Pike(cha đẻ Go lang):
Rule 5 . Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.


còn lô lốc triết lý và kĩ thuật khác nữa, nhưng chốt lại là sau gần 4 tháng trải nghiệm, cái thứ ngôn ngữ kì diệu vẫn luôn đem lại 1 sụ tròn đầy, trọn vẹn(fulfillment) mà ở mấy ngôn ngữ khác cảm giác như bị bóc lột(ruined) :lol:

Profile Image for Chris.
30 reviews2 followers
February 19, 2015
This was my third time trying to read through the book. The first was an attempt to follow along in Clojure. Didn't work out.
Second time was with the ebook version, again didn't work.

Third times a charm, grabbed a physical copy and worked through it over about 2 months at around 2 - 3 chapters a week. The programs are really fun and the authors writing is great. The book does cover functional programming a bit, but when it comes to implementing the last iteration of the dice of doom game, it feels like much of that gets put on the backburner.

Regardless, it was a great book and I had a super fun time working through it.
Profile Image for Michael.
162 reviews73 followers
May 29, 2011
Ever since I first learned about it, I was eagerly awaiting the release of Land of Lisp. If you have never heard about the book before, have a look at this promotional cartoon music video. Yes, that’s right, this book comes with its very own promotional cartoon music video!

http://landoflisp.com/

Your reaction to this video is actually a pretty good indicator on wether or not you are likely to enjoy this book. If you can’t take the cartoons and strange humor, “Land of Lisp” will probably not be for you. If you do however, you’ll be relieved that the book is at least as awesome as the video and probably even more.

People believing that Lisp has been dead since the AI winter may be surprised by the release of new book on the language in 2010. They may however have missed the release of Peter Seibel’s Practical Common Lisp in 2005, which managed to expose the language to a wider audience again, a feat I think “LoL” might achieve too.

For me the best part about Conrad Barski‘s book is its very readable and entertaining style, combined with cartoons and the use of small games as demonstrations of the techniques introduced in the book. I think this is what makes “LoL” really stand out from the other Lisp books: it’s neither as academic as most of the texts focussed on Scheme (with The Little Schemer being an obvious exception), nor is it as dry as Seibel’s book (which otherwise is a pretty good read) or as dated as Paul Graham’s On Lisp which was written while Common Lisp was still in the process of being standardized. For many people “Land of Lisp” may very well be there first contact with the language, and I think with its funny and easy to follow style it may get quite a few people hooked.

The book is structured in 4 main parts, the first of which – called “Lisp Is Power” – serves as a general introduction to the language, explaing the basic syntax and so on. The second part (“Lisp Is Symmetry”) introduces the reader to flow control, data structures, input and output, lambda expressions and more. In the process you’ll write the first part of a game engine for text based games, a great little version of Hunt the Wumpus called “Grand Theft Wumpus” and “Orc Battle”, a small strategy game played in the REPL. The third part (“Lisp Is Hacking”) introduces us to the powerful and sometimes disputed “format” and “loop” commands, as well as streams. Game-wise you’ll encounter a little simulation of an evolving world as well as “Attack of the Robots”, a retro game where your aim is to get rid of some robots by making them collide with each other. The last part (“Lisp Is Science”) introduces functional programming techniques, macros, DSLs and laziness. Besides finishing the text adventure started in an earlier chapter, you’ll also write “Dice Of Doom”, a Dice Wars clone that’s the most complex program of the whole book. Last but not least there’s an epilogue, where the author gives a brief overview of several important topics that got little or no exposure up to that point, like CLOS or the condition system.

As a final summary I’d say that “Land of Lisp” is a truly great achievement. It’s fun to read and does a good job of introducing the reader to the most important concepts of Lisp, by giving a taste of the language’s power, without being overwhelming. For more experienced Lispers this might make the book significantly less interesting, since some really nifty things only get mentioned in the epilogue. If you are among them, Seibel’s book is probably what you want to read (if you haven’t already, which would be surprising). I’d also advise you to not get too excited about the “game development” part of the book, except for the last one all the games are rather minimal and simple, so don’t expect writing 3d shooters or anything like that. They are however awesome examples of the concepts introduced in the individual chapters and way more fun than the contrived examples one finds in way too many programming books. For new Lispers or people who need to brush up on their Common Lisp skills (e.g. when migrating from some other Lisp) this comes highly recommend, but even more senior Lispers might want to get a copy, even if it’s only for the odd cartoons.
3 reviews1 follower
March 29, 2014
This book is super fun. Learn to program in lisp by hacking together old-school text-based computer games!

I worked through this book as a way to get into Clojure.
Profile Image for Julio Biason.
199 reviews27 followers
March 16, 2017
(Once again, ignoring the language itself to focus on the book).

Lisp is one hell of a language. Lots of things that are getting traction today already exist in Lisp for a long time. And, still, Lisp is not a common language. And this book shows why.

Just before reaching 1/4 of the book, there was a little piece of code that had nothing less than six "close parenthesis" in it. Just to have an idea of how bad it is, one of my friends that know Lisp inside and out rewrote the same piece of code using two new functions and hell, it was a lot easier to read -- simple because Lisp must be read from right to left, which most written languages use the other way around and reducing the closing parenthesis by moving pieces of code to other functions really does help.

The book also fails in a lot of places: There is the constant abuse of global variables, which breaks the idea of functional programming, one of the pillars of the language; the whole code focus on the REPL and nowhere it talks about using an external editor and running the code, although in the very end a magical "load" appears, out of the blue; there is some serious lack of contextualization about concepts: things are simply thrown out and then explained (there is a piece about minimax which the author simply explains the code after showing it and, in the next chapter, he finally explains the minimax concept, only to tell that the code could be "fixed" to follow it in only 23 lines -- no shit, Sherlock, you wrote half of it without ever explaining why you were writing it).

In the end, it's not a "oh so terrible" book, but it could really use some editing help.
Profile Image for Ondrej Sykora.
Author 4 books14 followers
December 28, 2011
A nice and playful book. Not much of a course book, but more a motivation to learn more about Common Lisp. Do not expect even an attempt at a language reference book. On the other hand, expect lots of nice examples and a great comic at the end :-)
49 reviews
March 29, 2011
Easily the most friendly introduction to Lisp that I've encountered. The games the book builds along the way are far more interesting than the programs most other books use to demonstrate concepts.
Profile Image for Aaron Schumacher.
181 reviews7 followers
December 23, 2021
Land of Lisp is an irresistibly fun Common Lisp book. The cartoon illustrations and "Learn to program in Lisp, one game at a time" subtitle don't fully suggest the depth of the content. Recursion is in Chapter 2, you write both Graphviz and raw SVG for graphics, you code up a web server from scratch, and you write your own lazy evaluation and multiple DSLs with macros before the end of the book. With that much material, some glitches sneak in, but it's still a very nice book.

I really liked some of the organization/presentation of material. The Periodic Table of the Loop Macro on pages 200 and 201 was one striking example.

The way the author memoized functions, by first defining the un-memoized version and then defining the memoized version with the same name, capturing the original function by closure, really tickled me.

There was also reference to a Haskel functional-style "database" that I thought was interesting. Maybe sort of like Datomic? And there were occasional references to other neat things; I may now read Implementation and Use of the PLT Scheme Web Server, for example.

I've thought about good ways to learn to program a little bit, even suggesting that learning Emacs/Lisp might be good. Then at least you can use Emacs Lisp to customize your editor. I don't think I know of any current Common Lisp projects.

It's nice when learning (and working with) a language to have a handy documentation system. Emacs Lisp has this in spades. In Python, I think beginners should know about, for example, help() and dir() very early. There's nothing like this covered in Land of Lisp. The only documentation referenced, as I recall, was the Common Lisp HyperSpec, which doesn't seem very beginner-friendly.

The most extremely anti-didactic bit of the book, however, has to be on page 382: "The only way to understand [these functions] is to stare at them for a long time." I think non-explanations like this are not likely to be helpful to anyone.

Then there are little glitches in the book. I suspect the book kept expanding and editors were overwhelmed:

* The intro to Chapter 7 claims to include things that don't start until Chapter 8.
* sexp is used in code but never explained, which I don't think is a good idea.
* pushnew is used on page 149 but not explained until page 368.
* On page 445 it says "Restarts are discussed in Chapter 14," but they aren't.
* On page 450 a reference to Chapter 16 should be to Chapter 17.

In the end the book can't cover everything. For example, the Common Lisp Object System is praised but not explained in enough detail for me to know why it's so great. That was particularly frustrating because I'd still love to see more about managing large projects in languages like Common Lisp or Clojure (with OO concepts or not).

I liked the book a lot; it's great recreational reading for language breadth.
Profile Image for Nitin Prakash.
9 reviews
July 8, 2023
I wish I had heard of this book when I was starting my Lisp journery a few years back.

Since, I already know Clojure, it was quite easy for me to follow through and do all the exercises via Clojure way. But I expect this is going to be dense for anyone coming from a different language. And rightfully so. It's quite nice that author has been able to keep it dense and beginner friendly.

Who I'd recommend this to?
- Anyone starting to code in general or starting to code in any lisp.
- Seasoned programmers unfamiliar with Lisp.
- Folks interested in PL design but have never touched Lisp (this is rare, possibly non-existent).
Profile Image for Dylan Meeus.
29 reviews1 follower
December 23, 2018
This book was the push that I needed to take LISP a bit more seriously, and I'm quite happy I did.

Perhaps at times the material could be a bit more clear though - and I do not enjoy text games (or normal games) as much, so I might not have been the perfect audience for this book. But it did serve as a light introduction and has accomplished that goal.

I do think it might help if LISP is not your first programming language. But then again, if you are considering picking up this book, I'm sure you've already mastered other PLs.
Profile Image for Geoff Lanotte.
164 reviews7 followers
November 10, 2017
I enjoyed making my way through the book, it chose to take the tutorial approach, which can be handy but I would have enjoyed any exercises as.a means to stretch and extend what was explained in the book.
Profile Image for Gustav Bertram.
34 reviews9 followers
August 1, 2018
Great start, but slows down a lot around chapter 18, since it rehashes a previous game over and over.

I would recommend switching to another book like Practical Common Lisp once you're not enjoying this one any more. However, do read the comic at the end before you're done with the book.
Profile Image for Luis Borjas.
38 reviews
November 26, 2018
A deviation from my usual literature forays, but Common Lisp is a language I wanted to explore for almost a decade now and finally got around to playing around (literally: you build games in this book) with LoL.
123 reviews
September 6, 2020
If you already know a Lisp you can burn through it, there might be a tidbit here or there you can pick up.

I'm not sure I'd have someone read it as their first introduction to Lisp at this point, but it is presented in a way that would likely make it fun to learn.
Profile Image for Andey Robins.
31 reviews
May 25, 2023
Woof, that was dense. Perhaps it's difficult to get through because it's trying to cover the breadth of lisp, but I would have preferred a slightly higher level of abstraction than the book went through.
Profile Image for Anton Antonov.
202 reviews54 followers
September 6, 2018
A fun book, but where are we going with that LISP...?

For 3 years this book has been an off and on read and I've dropped it somewhere in the middle.

It just has no interest to me.
Profile Image for Bruno Fernandes.
38 reviews1 follower
August 29, 2020
Really fun book. A little too descriptive for an experience programmer but still easy to read.
Profile Image for Lech Jankovski.
29 reviews6 followers
May 27, 2014
Everything was fine except for:

- strange statements like "dispatching to a specific implementation of the method based on the types of multiple objects. This is a feature that is not available in traditional object-oriented languages, such as Java or C++.". WHAT?
- so many global variables.. They might've been useful for the purpose of the demo and maybe in order to somewhat simplify some things, but it doesn't sound like recommended practice to me (zero warnings on that matter). And worst of all — global variables were modified..
- function naming in Common Lisp.. `defparameter` sets variable value, that can be overwritten (simple variable), however, `defvar` defines value, that CAN'T be overwritten (constant). Why the hell `defVAR` then? And to put a cherry on top: author starts to use `setf` without explaining any reasons. And then some functions that can't be guessed without reading the full docs: `ash`, `progn`, `cond`, `assoc`, `labels`, `decf`, etc. IMHO Clojure does better job in promoting Lisp compared to Common Lisp..
9 reviews
December 14, 2014
A very fun read on various aspects of programming. From a brief history at the onset to a small string of games, there was a lot to keep me going through here. It was especially refreshing to see LISP given a treatment where it is solidly not just a single style of programming. Indeed, the point is made that the various styles of programming should be used with each other for their benefits. Not that any one style completely dominates.

Also impressive is that all of the games are fully self contained. That is, even though you wind up building a web server to host one game, all of the code used in making this is in the book. I was afraid there would be a section where "import ridiculous library" would appear and then the rest would be showing off some library. Not necessarily a bad thing, of course. Still, I was delighted everything was self contained.

Definitely check out the samples of the book that you can get online. If those are of interest, they are not a "best of" from the book. Simply put, if you like the samples, you are going to like the book.
5 reviews1 follower
July 31, 2012
I'm very happy with this book. I have wanted to look at Common Lisp for a while, and this book helped get me up to speed not just in the language, but in what is considered idiomatic Lisp code. The games format reminded me of how I learned to program in junior high, with Creative Computing and TI Magazine's printouts of games in BASIC.

If you want to learn Lisp, and want to see sample programs, then this would be a good book. It is aimed at novice programmers, so if you already know what higher order functions are, then you will have to be patient with it. But considering the target audience, this book does a great job.
Profile Image for Adolfo.
14 reviews4 followers
March 3, 2011
A fun and easy to read book that will teach you the basics of common lisp. It uses as examples some classic videogames like a Zork-like IF game, an RPG combat system, etc. that, while not exciting, kept me motivated.

The only downsides are: no CLOS, and some uninformed comments made by the author (e.g.: "Lisp invented type inference"). Also, the book abuses conses as a data structure; this gives the false impression that in Lisp (almost) everything is a list.

Anyway, this is a good introduction to common lisp and an overall fun book.
49 reviews4 followers
Read
November 7, 2010
Not bad. Not great. A comic-filled romp through modern, non-recursive LISP programming. I didn't bother reading any of the comics, so I can't comment on those. With a subtitle like "One Game at a Time!", I would have expected a more about games than was there. A number of the games themselves were 1970s-style text games which, while not without their charms, seem a tad dull and dry compared to the games you can create with packages like Processing.
Profile Image for Nick.
125 reviews9 followers
March 4, 2012
I had a good time reading this, and it wasn't just the comics (although, the one half-way through with the Land of Lisp vs the Republic of Haskell made me laugh). I guess I'm not particularly likely to go start coding anything up in LISP any time soon, but it was fun to read about, all the same. One of the projects spanning this book involves writing a web server and returning svg to display the game state, which is pretty cool. I'm on to Learn You a Haskell! next.
6 reviews
December 27, 2012
A fun, easy-to-read introduction to Common Lisp that steers clear of the usual dry, business-oriented examples and mindset -- you're guided, step-by-step, in the development of games, rather than Yet Another Bookstore Simulation Laden With Pointers To Best Practices. Recommended for both newbies/beginners and those who, like me, are trying to transition from other Lisp dialects.
Profile Image for Coen.
22 reviews3 followers
September 23, 2011
Really a fun book to read, and a great introduction to Lisp. With humorous (cartoons) and playful examples all of lisp's concepts are very well explained. Highly recommended for developers who want to check out (the land of) Lisp.
49 reviews10 followers
June 4, 2012
Great intro to lisp and the functional paradigm, lots of example code. COMICS!
Displaying 1 - 30 of 36 reviews

Can't find what you're looking for?

Get help and learn more about the design.