Land of Lisp
vsedach writes "Remember the 1980s and BASIC, when programming was simple, brains flew through space, and everyone ate lasers? Computer magazines came with code listings, and classics like David Ahl's BASIC Computer Games offered a fun and easy way to get started in computer programming. Conrad Barski remembers, and with Land of Lisp, he's set out to demystify programming in the 21st century." Keep reading for the rest of Vladimir's review.
Land of Lisp: Learn to Program in Lisp, One Game at a Time!
author
Conrad Barski, M.D.
pages
504
publisher
No Starch Press
rating
10
reviewer
Vladimir Sedach
ISBN
978-1-59327-281-4
summary
Learn to Program in Lisp, One Game at a Time!
This is no small feat. Modern computers don't come with anything that looks like BASIC. Getting started with a "real" programming language like Java requires installing and learning hundreds of megabytes worth of compiler and integrated development environment. Barski's thesis is that Lisp is a refreshing alternative - it offers BASIC's ease of getting started (get a prompt, type in code, and it works), while providing a combination of modern features unmatched in other programming languages.
The first thing that immediately jumps out about Land of Lisp is that it has a lot of comics. The book is an outgrowth of Conrad's Casting SPELs in Lisp illustrated online tutorial, which originally appeared in 2004 (incidentally, around the same time as why's (poignant) guide to ruby, probably the most famous and epic programming language comic book). The comics are humorous and irreverent - if you're a C programmer, you might be surprised to know that you're a Cro-Magnon fighting the COBOL dinosaur.
Despite the silly humor and Barski's approach of introducing programming completely from scratch, Land of Lisp builds up to cover topics like graph theory, search algorithms, functional and network programming, and domain-specific languages. All throughout, the book emphasizes various techniques for doing I/O. The topics covered will leave the reader with a solid understanding of what modern programming entails and a good basis from which to explore either application or lower-level systems programming.
The most unintentionally impressive aspect of Land of Lisp is that it manages to completely explain web programming. No more hiding behind complicated software stacks and impenetrable web server packages - chapter 13, titled "Let's Create a Web Server!," does exactly what it promises, in only 15 pages. Later chapters introduce HTML and SVG to build a graphical game as a web application. If nothing else, this book will leave the reader with all the necessary basic skills and total confidence in their understanding to build real-world web applications.
Other introductory programming books use Lisp, but none fall into the same category as Land of Lisp. Abelson, Sussman and Sussman's Structure and Interpretation of Computer Programs, arguably the greatest introductory programming book ever written, requires a solid math background to understand the examples. Felleisen et alia's How to Design Programs offers a much deeper introduction to programming than Land of Lisp, but is an academic textbook, and hence lacks funny cartoons and may be boring. Friedman et alia's The Little Schemer is a favorite of many, but doesn't have LoL's real-world applications.
Land of Lisp is an excellent book for someone who wants to learn how to program, for web programmers who want to move up out of their niche and start learning about CS theory and systems programming, and for anyone who is puzzled about what really goes on behind the web and wants to learn what web programming is really about. Experienced programmers who want to jump into using Lisp are probably better off with Peter Seibel's Practical Common Lisp, though.
Watch Conrad's hilarious promotional music video for the book.
You can purchase Land of Lisp: Learn to Program in Lisp, One Game at a Time! from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
The first thing that immediately jumps out about Land of Lisp is that it has a lot of comics. The book is an outgrowth of Conrad's Casting SPELs in Lisp illustrated online tutorial, which originally appeared in 2004 (incidentally, around the same time as why's (poignant) guide to ruby, probably the most famous and epic programming language comic book). The comics are humorous and irreverent - if you're a C programmer, you might be surprised to know that you're a Cro-Magnon fighting the COBOL dinosaur.
Despite the silly humor and Barski's approach of introducing programming completely from scratch, Land of Lisp builds up to cover topics like graph theory, search algorithms, functional and network programming, and domain-specific languages. All throughout, the book emphasizes various techniques for doing I/O. The topics covered will leave the reader with a solid understanding of what modern programming entails and a good basis from which to explore either application or lower-level systems programming.
The most unintentionally impressive aspect of Land of Lisp is that it manages to completely explain web programming. No more hiding behind complicated software stacks and impenetrable web server packages - chapter 13, titled "Let's Create a Web Server!," does exactly what it promises, in only 15 pages. Later chapters introduce HTML and SVG to build a graphical game as a web application. If nothing else, this book will leave the reader with all the necessary basic skills and total confidence in their understanding to build real-world web applications.
Other introductory programming books use Lisp, but none fall into the same category as Land of Lisp. Abelson, Sussman and Sussman's Structure and Interpretation of Computer Programs, arguably the greatest introductory programming book ever written, requires a solid math background to understand the examples. Felleisen et alia's How to Design Programs offers a much deeper introduction to programming than Land of Lisp, but is an academic textbook, and hence lacks funny cartoons and may be boring. Friedman et alia's The Little Schemer is a favorite of many, but doesn't have LoL's real-world applications.
Land of Lisp is an excellent book for someone who wants to learn how to program, for web programmers who want to move up out of their niche and start learning about CS theory and systems programming, and for anyone who is puzzled about what really goes on behind the web and wants to learn what web programming is really about. Experienced programmers who want to jump into using Lisp are probably better off with Peter Seibel's Practical Common Lisp, though.
Watch Conrad's hilarious promotional music video for the book.
You can purchase Land of Lisp: Learn to Program in Lisp, One Game at a Time! from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
(incidentally, around the same time as why's (poignant) guide to ruby, probably the most famous and epic programming language comic book)
Hey, take it easy there, this is a book review meant for humans (not some code for an interpreter)!
Oh great, now you've got me doing it too. Do you have any idea how long it took for this to go away the last time I coded Lisp?
*obsessively tallies and double checks to make sure he closed all his parentheses before hitting submit*
My work here is dung.
But where's our new hyper advanced LISP machines?
Nothing will beat the Symbolics Lisp machine. Clozure is great, but not quite there yet.
...they'd never end... Sigh. I remember David Ahl's Basic Computer Games with such nostalgia, spending my first weeks in late 1974 as a freshman typing in SUPER STAR TREK onto paper punch cards to run on the IBM360 at University of Tennessee. As a county bumpkin coming into the land of Oz where there were Real Actual Computers I could work with for the first time, I though I had Entered The Future. Little did I know that the future had only begun, and continues today. Probably will continue into tomorrow, too.
If you're a C programmer, you might be surprised to know that you're a Cro-Magnon fighting the COBOL dinosaur.
From the "random" quote of the day at the bottom right of the page:
COBOL is for morons. -- E.W. Dijkstra
My work here is dung.
Denote keyword arguments?
(happy :o(sad))
I wouldn't recommend BASIC or LISP for someone wanting to learn modern object-oriented programming today. A lot of us started out with a structured languages like this, but you wouldn't want to start out that way if you were doing it for the first time now. My university uses Alice and it works pretty well. Alice teaches much more modern object-oriented principles that would be much more useful than BASIC or LISP to a modern programming student.
SJW: Someone who has run out of real oppression, and has to fake it.
Perhaps it speaks to the fact that there are so few real world programming tasks that require cool but obtuse capabilities that take longer to master than the much simpler code in other languages?
Sig Battery depleted. Reverting to safe mode.
I wouldn't recommend BASIC or LISP for someone wanting to learn modern object-oriented programming today. A lot of us started out with a structured languages like this, but you wouldn't want to start out that way if you were doing it for the first time now. My university uses Alice and it works pretty well. Alice teaches much more modern object-oriented principles that would be much more useful than BASIC or LISP to a modern programming student.
Common Lisp has object oriented techniques that Java-like languages still fail to have, like multiple-dispatch and metaclasses. Read your manuals before speaking lies, Common Lisp has the most advanced OO system among modern programming languages.
Pay no attention to my user name- I promise to respectfully answer any questions you may have, about Lisp or the book!
Because there is no -1 Moron
To get the most out of LISP, you really have to approach it with a mindset particularly distinct from most programming. It also happens to be distinct in nearly requiring recursion that is generally not part of an 'easy' getting started with programming. That and most people will club themselves over the head trying to sort out how many close parentheses are needed when they write something *particularly* 'clever'.
If in modern Windows, Powershell is a good starting point, if in Linux, Python. Unlike LISP, both yield immediately marketable skills and are easy to start toying with basics and do not require a lot of knowledge of where to go to get it running, it already exists on your platform (almost certainly).
I do agree that 'web frameworks' have mutated the relatively straightforward nature of underlying http into a frightening looking mystery to the uninitiated, but at least some in the industry are swinging back to the basics and discarding some of the oddly complex schemes over HTTP.
XML is like violence. If it doesn't solve the problem, use more.
Common Lisp, which is what the book uses, has the first ANSI standard OO programming system, CLOS - short for the "Common Lisp Object System" - which includes multiple inheritance, generic functions, a meta-object protocol, and is in all essentials, a superset of the capabilities of the object systems of mainstream OO languages such as C++, Java, Smalltalk and Objective-C.
No one is advocating entering a time warp to the 1960s to use LISP 1.5 for the teaching of modern OO programming, least of all Conrad Barski, the author of Land of Lisp, which uses ANSI standard Common Lisp.
http://www.planetpdf.com/codecuts/pdfs/ooc.pdf
Speaking as someone who does a lot of real-world programming in non-LISPy languages, I don't think so.
I love Python, and it's considerably more capable than Java or C in terms of metaprogramming... but I can't tell you how many times I wish I could add a bit of syntactic sugar to replace an awkward construct built to work around Python's no-sharp-edges syntax. LISP-style macros may be abusable, but they're also beautiful, beautiful things.
Can I buy it as an elecrtonic copy, e.g. Kindle?
I saw electronic copies available on O'Reilly's site. Not exactly a huge cost benefit but that seems to be the norm.
My work here is dung.
Because when every programmer is a god, all ends in strife and horror and mutation.
See: Greek Pantheon. Or Bioshock.
Mind you, I love Lisp. But I wouldn't if I were working with anyone else on the same code for any length of time.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
You're kidding about VBScript, right? Short of abusing Scripting.Dictionary in some rather awful ways you can't even define data structures in it, and writing code that spans more than one module involves the use of some obtuse XML crap (.scs files) which most people don't even know about. VBScript has its place but using it for anything other substantially more complex than short straight-line automation scripts is lunacy.
You could write some ephemeral JavaScript programs in an .html file that can't even interact with the filesystem, sure, but these creations would be obvious fourth-class citizens on your shiny 21st century computer, which doesn't yield a particularly satisfying experience for the novice programmer.
No, if a kid with an internet connection wants to start programming stuff then in some senses the ground has never been more fertile. Even if you're not willing to leave Win32 you can quickly and easily download IDLE or a win32 build of Ruby, and the latter has plenty of really gentle tutorials to ease a novice into the world of programming, to the point where the interested reader could probably stumble oneward from there through Wikipedia well enough for most of the intermediate concepts to stick. The sort of things you can easily accomplish with MinGW and a bit of Googling today would have absolutely blown my ten year old mind back when anything above the level of BASIC was a forbidden art unheard of outside of obscure BBSes (which show up on your parents' phone bill) or a university library.
On the other hand, a modern PC environment is a frightfully complicated beast compared to an Amiga or a Spectrum. That I think is far more of a problem than the availability of simple tools and documentation these days... that and a more comfortable consumption-oriented environment on a modern desktop that doesn't force you to make your own fun.
First, Lisp is not an acronym.
Second, Lisp has the CLOS, which is an advanced OOP system in its own right with multiple inheritance, polymorphism, encapsulation, multiple dispatch and all that other groovy nonsense. It's no setback compared to "modern" OOP.
Can anyone post links to any Lisp web application? It can be something different then the HTML & SVG web game, though I would be extra keen to see that run...
Can't find it hosted but found the code to the book at the homepage that includes both the svg.lisp and webserver.lisp (also check out CL-HTTP). As to your more generic question, I think this year's lisp game expo competition had a few good Lisp web games.
My work here is dung.
AppleScript is much easier to understand than to write. Nearly everyone winds up using it in an autotools-like way, looking for examples online and adapting them, with a lot of superstitious behavior. It's extremely hard to write non-trivial AppleScript, and I'm speaking as a professional programmer with command of plenty of languages.
No, I don't really know of lots of copy and paste style redundant code in my C or C++ applications. Generally functions take care of that. If a problem comes up enough, said function is stripped out and added to a library. These are not new or novel concepts, people have been doing them for decades now.
Sometimes people will add lots of copy and paste code to a codebase. We call these people bad programmers, and they tend to be fired.
I read the internet for the articles.
My understanding is you'll be able to download the mobi/epub versions for free when they become available if you buy the PDF now.
Thmileys make lithp talk thrange.
Free Martian Whores!
The great thing about learning Lisp as a first language is the lack of marketability, because it's to about setting you up on a path, it's about giving you fundamentals.
As noted there is enough syntactic sugar now to not cause the kinds of rough work that used to be around, and I think the brevity of the language can be good for people in that there's not a ton of syntax to learn to actually get something real built.
Once you have programmed in at least two languages, you have a much better idea of what you are doing I think. So given that you'll learn some "practical" language to do something, let Lisp be that "other language".
"There is more worth loving than we have strength to love." - Brian Jay Stanley
However, is there a reason why all such couldn't be explained with something more modern, like Python?
<humor>The sound you hear now is the sound of the old timers loading their shotguns.</humor>
I'm only a few years older than you (25, soon to be 26) but learning Lisp was a very, very rewarding experience - at least to me. Even if I'm probably never going to code in Lisp (or Scheme, my personal favorite) it teach me to better think in the way I code. If you have some time in a free Tuesday evening (well, more than one, actually) try take a look at Structure and Interpretation of Computer Programs by Abelson, Sussman and Sussman. It's not in Lisp but in Scheme, a very close language. You probably saw most of the concepts in college but, for me at least once more, it was reading it that I felt a "gotcha" moment and finally understood it.
English is not my first language. Corrections and suggestions are welcome.
What Lisp promised then is what Python promises now. With one difference, in that Python respects the visual limitations of humans.
Different from parentheses, it's very easy to undo a bunch of indentations, just put the left margin where you want it.
Well, if only the TAB character had never been invented... TAB is a kludge to make a typewriter behave sort of like a spreadsheet but, unfortunately, it fucks up the excellent "Don't mix content with presentation" principle.
Saying "Don't mix content with presentation" is pretty rich from a Python advocate, when Python does precisely that. It mixes presentation (what code looks like) with content (what code does).
Besides, don't you know that in Lisp, parentheses are indentation symbols? They tell how the code should be indented, and changing indentation is just a matter of changing parentheses. If anything, adjusting indentation of Lisp code is easier than adjusting indentation of Python code.
What, like for loops? Variable assignments? Could you give an example of code duplication common in C code that would not occur in Lisp?
I read the internet for the articles.
Python does precisely that. It mixes presentation (what code looks like) with content (what code does).
To some extent, every language does that. What I meant is that the TAB character introduces an arbitrary visual configuration that's not part of the language itself, which can confuse things when tabs and spaces are mixed in the same source file.
However, this does not mean that the presentation of the code is unimportant. For instance, a reason why I once programmed in Pascal but switched to C was that I found braces easier to read than "begin ... end" pairs. Curly braces are clean and small symbols, looking at the source code at a glance they are easier to identify than multi-character keywords.
When you are writing and reading code by the hundreds of thousands of lines, every detail becomes significant. That's something language theorists often fail to understand, but Dennis Ritchie and Guido van Rossum got perfectly right.
...which is why Clojure (by providing tools to interoperate with its host VM's class system and providing its own collections framework -- the latter tightly integrated with the language and supporting copy-on-write support to ease functional programming with immutable objects) has the potential to pull LISP into widespread, real-world use.
I've actually had a (Fortune 50) employer put Clojure to use for a tool parsing an extremely high-volume data feed in near-real-time; the project was a roaring success, and the choice of tools was no small factor.
i STILL eat lasers ....
Read radical news here
I disagree, LISP is fine for beginners. I mean an entire OS, emacs, is written in LISP; too bad it doesn't come with a good editor...
Seriously, guys, who in their right mind believes there have been no major advances in programming languages since Lisp?
Oh, I'll admit that 99.9% of the supposed "advances" have been horseshit...
Seastead this.
Python respects the visual limitations of humans
It does exactly the opposite, unless humans can evolve to literally "see" whitespace characters.
The zen-like empty indentation technique drove me mad when I had to maintain some python software. It reminded me for exactly the thing I hated most about the little Fortran I had done in school, the punch-card like need for rigid character placement in something that was, to my mind, meant to be a totally logical construct.
As another poster noted, Python mixes presentation with content and that makes it really awful to do refactoring, or for tools to be able to offer you meaningful help in reformatting. A code reformatter can take a mess of code differently indented and make it correct according to your preferred spacing. It can also take pasted code and place it at exactly the right level of indentation. What is a code formatter to do when you try to paste code directly after an indented line of python? Any guess can be wrong, and all it CAN do is guess.
I actually like the language otherwise, I like the constructs, but the whitespace thing makes it basically unusable for me in practice. At this point if I want to learn a nice alternative and powerful language, I'm going for Erlang.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Python does precisely that. It mixes presentation (what code looks like) with content (what code does).
To some extent, every language does that. What I meant is that the TAB character introduces an arbitrary visual configuration that's not part of the language itself, which can confuse things when tabs and spaces are mixed in the same source file.
I think better solution to not having tabs would have been if C would only have accepted tabs as indentation. And if python had "one tab is one level of nesting", I think that'd have been better too.
Problems only arise when mixing tabs and spaces, and when not agreeing how many spaces indentation is, or how many spaces tab is. I'm sure most of us have encountered source files which have had all three of these, after being edited with many people with different editors and settings. "One TAB equals one level of indentation" would fix all that. Any programmer could use any amount of spaces for displaying tabs in editor, and it would not affect the source file.
However, this does not mean that the presentation of the code is unimportant. For instance, a reason why I once programmed in Pascal but switched to C was that I found braces easier to read than "begin ... end" pairs. Curly braces are clean and small symbols, looking at the source code at a glance they are easier to identify than multi-character keywords.
When you are writing and reading code by the hundreds of thousands of lines, every detail becomes significant. That's something language theorists often fail to understand, but Dennis Ritchie and Guido van Rossum got perfectly right.
Indeed. However, these days code presentation, including automatic indentation, is largely taken care of by the editor (and if it isn't, maybe it's time to either learn to configure it, or switch to a more capable one). Except this is rather hard for Python, for the obvious reason. IMHO this is a serious and unique shortcoming of Python.
Well, if only the TAB character had never been invented... TAB is a kludge to make a typewriter behave sort of like a spreadsheet but, unfortunately, it fucks up the excellent "Don't mix content with presentation" principle.
I actually like tabs.
I used to be in the "use spaces only" camp many years ago, but then I found out that I prefer proportional fonts to monospaced. When using those, you need more indentation; two or four spaces isn't going to be enough. So, I normally use tabs with the equivalent of six, and I switch to eight or ten when I'm dealing with highly-indented blocks of code.
If I used spaces alone and inserted a whole bunch of spaces to accomodate for my font preference, whoever looks at that code later in a monospaced font would get a sudden urge to kill me.
That's the whole beauty of it; in fact, tab characters *separate* content from presentation. A tab can be two spaces, or it can be ten. Meanwhile, spaces are just spaces. To put it differently, tabs are CSS, and spaces are inline style crud on HTML elements. So, to be honest, I really don't get your point.
I'm the reviewer, so I can probably explain how this happens.
I started out writing posts on my blog about old obscure distributed systems and programming books that I thought deserved more attention. Then I got a copy of Masterminds of Programming for giving a lightning talk at a conference (International Lisp Conference 2007; O'Reilly were giving out books to lightning talkers), and decided to write a review on my blog (it's an interesting book).
A few months later, Peter Seibel's Coders at Work was about to come out, and Peter noticed that I had written about Masterminds and decided that I would be interested in a preview copy of Coders at Work (which I was). Then he mentioned that I should consider writing a review for Coders at Work on Slashdot instead of my blog, and I liked the suggestion, so I wrote a review (it is a good book). Peter says it helped the book's sales a lot.
I heard about Land of Lisp from the O'Reilly media relations mailing list (I'm on the list because I'm the O'Reilly User Groups program contact for the Montreal JavaScript user's group; they give us discounts and freebies). The media relations list is basically O'Reilly spamming you with descriptions of upcoming titles - if you think something is interesting, you ask them to send you a review copy. Actually, I had heard about Land of Lisp a long time ago (the book was originally supposed to come out in 2007), but forgot about it in the meantime. If it wasn't for the O'Reilly mailing list, I wouldn't have heard about the book until after it had come out (and then only because I'm very involved in the Lisp community).
So the lesson here is you should look for someone interested in the book's subject who has written about other books before, offer to send them a review copy, and suggest they write a review for Slashdot. It helps to stroke their egos ("I really like your writing, would you like a super-special advanced exclusive preview copy for super-smart special people? The proles won't get to see this for another two months!")
Obviously blogs are the best places to find these people; look at blog aggregators on whatever subjects your book is about (for example, the Lisp-related postings on my blog are syndicated on Planet Lisp and Russian Lisp Planet).
O'Reilly has by far the best book promotion efforts of any technical publisher (media relations mailing list, user's group program, and an extremely active presence at conferences), but it's actually not very effective compared to being part of whatever community your book is about, and simply informing community members of your book's existence. Conrad does pretty well in this respect. I'm sure if I hadn't written a review of Land of Lisp for Slashdot, someone else would have.
"Lost In Stupid Parentheses."
Any decent programmer should know more than one language. If they can't adapt to a new language, they need to spend some more time learning how to think differently. Preferably, one of the languages they know should be lisp-like. Not because it's necessarily relevant to today's web-based micro-apps, but because it can teach you to THINK differently.
I know some programmers who know several languages, but they write as if every one of them was Fortran. You can lead the horse to water...
A lot of it is working on site, often with borrowed equipment, and under fairly strict security limitations. I might get given the code in a zip file and have to edit it on windows on notepad. Or I might be using the console port on an alpha server running Tru64 4.0
These are just examples. They are created by circumstances. Python places to much reliance on the text editing environment.
http://michaelsmith.id.au
C doesn't care at all about indentation. You can remove all the lefthand space from a C program without affecting it in any way. Pythons meaningful whitespace is a terrible idea, absolutely horrific really.
Well, C cares about indentation in the way, that indentation has to be spaces or tabs, if there's any. Worst of all worlds, which is discovered by anybody who has worked with mixed up tab-space settings in files in version control. Worst case is having different amount of space per tab been used in different parts of the code, and tabs not used consistently. Result is, no matter how you configure the editor, some part of the code gets indented unevenly, and you can't fix it without messing up version control diffs.
Funny. To date, Common Lisp still has the most powerful and feature-complete OOP system ever designed in a programming language.
Two comments about the summary:
Programming today is easier than programming in the 80s, if you pick the right language. BASIC wasn't that easy -- although at least on most computers there was no installation step.
Most people who typed in games from magazines weren't doing it to learn -- they wanted to play the game, and printing the BASIC code on paper was more cost effective for the publishers than gluing a cassette to the magazine. Typically there would be no comments, no discussion of the techniques use, and towards the end of this practice's lifetime, it wasn't unusual for the program to be a small piece of BASIC for poking integers into memory, followed by several A4 pages of hex characters; the machine code for the game.
Once you have programmed in at least two languages, you have a much better idea of what you are doing I think. So given that you'll learn some "practical" language to do something, let Lisp be that "other language".
I concur, and would add that being proficient with five languages is not too high a bar to set for a professional developer. (Not a world-leading expert, but able to Write Good Code(tm))
Heck, I know C, C++, python and shell scripting *very* well (IMNSHO); haskell, java and scala decently; scheme, elisp and SML/NJ somewhat; javascript, C# and perl superficially, [...].
But then again, scheme and javascript are basically the same language, and python is a funky dialect of it with elisp being a close cousin. C++, java and C# are becoming more and more similar (there's a language conceptual overlap, aneehoo), C is a subset of C++, ML ~= Haskell. As you might see, ten languages is a lot easier to learn than ten times the difficulty of learning the first language.
(Sorry if I come off as bragging; I don't mean to, I'm just using myself as an example, and I don't think I'm a crazy-ass whiz kid)