Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Books Book Reviews

Land of Lisp 330

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.

*

This discussion has been archived. No new comments can be posted.

Land of Lisp

Comments Filter:
  • Lisp is cool... (Score:3, Interesting)

    by RocketRabbit ( 830691 ) on Wednesday November 03, 2010 @03:02PM (#34115472)

    But where's our new hyper advanced LISP machines?

    Nothing will beat the Symbolics Lisp machine. Clozure is great, but not quite there yet.

  • by cybrpnk2 ( 579066 ) on Wednesday November 03, 2010 @03:04PM (#34115500) Homepage
    ...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.
  • Re:Lisp is cool... (Score:5, Interesting)

    by Animats ( 122034 ) on Wednesday November 03, 2010 @03:16PM (#34115634) Homepage

    Nothing will beat the Symbolics Lisp machine.

    Ever use one? I've used the refrigerator-sized Symbolics 3600. 45 minute garbage collections. Flaky electronics. An arrogant service organization. Those things lost out to general purpose UNIX workstations for good reasons. Even for running LISP, a SUN 2 was better than a Symbolics 3600.

    (Symbolics was also tied in strongly to the 1980s expert systems crowd, the "strong AI Real Soon Now" people", like Ed Feigenbaum. I went through Stanford CS when those guys were running the department, just as it was becoming clear that expert systems really couldn't do all that much. Not a happy time in academic computer science. Stanford had to move computer sciences from Arts and Sciences to Engineering, and put in adult supervision.)

  • by icebike ( 68054 ) on Wednesday November 03, 2010 @03:20PM (#34115670)

    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?

  • Lisp web apps? (Score:1, Interesting)

    by Anonymous Coward on Wednesday November 03, 2010 @03:30PM (#34115834)

    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...

  • Re:Lisp is cool... (Score:2, Interesting)

    by Anonymous Coward on Wednesday November 03, 2010 @03:36PM (#34115906)

    I detested programming in Lisp. The endless parentheses tracking and macro soup made it a miserable experience. It seems to be mainly popular with people who don't have to actually write the code.

  • by Second_Derivative ( 257815 ) on Wednesday November 03, 2010 @03:56PM (#34116186)

    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.

  • Comment removed (Score:3, Interesting)

    by account_deleted ( 4530225 ) on Wednesday November 03, 2010 @04:16PM (#34116454)
    Comment removed based on user account deletion
  • by jandrese ( 485 ) <kensama@vt.edu> on Wednesday November 03, 2010 @04:41PM (#34116768) Homepage Journal
    What, like for loops? Variable assignments? Could you give an example of code duplication common in C code that would not occur in Lisp?
  • by cduffy ( 652 ) <charles+slashdot@dyfis.net> on Wednesday November 03, 2010 @04:47PM (#34116810)

    ...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.

  • by SuperKendall ( 25149 ) on Wednesday November 03, 2010 @05:53PM (#34117494)

    I should be able to easily enter in blocks of code without having to rely on crutches like IDEs to make sure I have the correct number of parenthesis.

    That's an issue with braces in any other language, just check your C++ example... or any code with nested if statements and a bunch of closing braces.

    As with any paired construct, the solution is to enter both halves before you type anything else - so I always enter:

    ()

    And then type into it. You don't mismatch parens that way - editors are nice in that they can check veracity, but not really necessary if you format code at all well.

    Also since you are big on saving characters, what happens when you add an else into your example:


    void foo( int x )
    {
        if (true-expresion)
        {
            then-expression ;
        }
        else
        {
            else-expression;
        }
    }

    vs:

    defun bar (x)
        (if (true-expression)
            (then-expression)
            (else expression) )
    )

    Over a lot of code, I always found Lisp to be more readable and less wordy even if there are a few more parens.

  • by johnjaydk ( 584895 ) on Wednesday November 03, 2010 @06:01PM (#34117584)
    I paged through the book yesterday and I'm looking forward to go through it in detail. It's SO nice to find a book on lisp that doesn't make You want to carve out Your eyeballs due to sheer dryness.
  • by Wolfbone ( 668810 ) on Wednesday November 03, 2010 @06:37PM (#34118010)

    rely on crutches like IDEs [...] t has a lot of unncessary and redudant parenthesis that do nothing except clutter up code, making that crap near un-readable [...] Algol-like languages have a better mapping to mathematical functions. foo(x) vs (foo x)

    IDE? A programmer's editor is all you need. In the Real World (TM) I suspect most programmers are already 'reliant' on such ubiquitous crutches!

    The parentheses are necessary and are not redundant - the necessary minimum in fact - and do not "do nothing except clutter up code". Far from it. One of the first things someone new to Lisp should know - especially if they are used to languages bogged down in complex syntax and so ironically initially view the parentheses as a distraction instead of as an aid (as more experienced Lispers will) - are the great advantages of having the written code in the form of a simple tree structure. The fabled power of Lisp macros - something many people have heard about and which may have attracted them to Lisp in the first place - is facilitated by this simplicity.

    "Better mapping to mathematical functions"? I can't even guess at how you arrived at that judgement. All I can say is that, of all the programming languages I've tried, Lisp is by far the most pleasingly congruent with my mathematical aesthetics, conventions and habits of thought. (And no, I don't like Haskell - I've heard it said how "mathematical" it is but I suspect that in this case the programmer and comp. scientist view may be at odds with the generalist mathematician's view.)

    PS. It's confusing and cluttery bad Lisp style to put the closing parentheses on lines by themselves. ;-)

  • Yes, yes, for loops! (Score:1, Interesting)

    by Anonymous Coward on Wednesday November 03, 2010 @09:14PM (#34119488)

    What, like for loops?

    For loops are a perfect example. Why the hell do all these programming languages force me to write the same damn patterns over and over, like, say, reducing a sequence of values:

    result := initial_value
    for ( element in collection ) { result := function(element, result) }

    How many million times have you written a loop that follows this pattern? What about this one:

    result := new Collection(collection.size)
    for ( element in collection ) { result.add(function(element)) }

    Looks familiar, right? C-style languages all but force you to constantly spell out how to iterate over the elements of a collection or sequence and combine their values; the only ways to abstract it are way more verbose than this (e.g., iterator classes, Visitor pattern), or are subject to additional problems (function pointers in C aren't anonymous, and are not lexically scoped).

    The first of those examples should just be reduce(function, initial_value, collection). The second is map(function, collection). These functions allow you to write code that's shorter, because you don't need to write the same damn canned for loop pattern over and over.

    In addition, there's a more important, subtler benefit, that comes down to this:

    • For loops specify how to iterate over a collection.
    • Functional combinators specify how the structure and values in the input are related from to the output.

    This means that, for example, when you see map being used, you know automatically that the result is a collection of the same size as the input, where the value of each element of the output collection depends only on the element of the input in the corresponding location; i.e., map has predictable invariants that help you reason about the code. When you see a for loop with a complicated body, on the other hand, you have to read the damn thing, often very carefully, to figure out what the hell is going on.

  • by jonaskoelker ( 922170 ) <`jonaskoelker' `at' `yahoo.com'> on Thursday November 04, 2010 @10:29AM (#34124062)

    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)

Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.

Working...