Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask news.YC: For the lisp experts - tell me how you learned the language.
17 points by comatose_kid on Sept 23, 2007 | hide | past | favorite | 21 comments


I'm no expert, but I'd suggest two things.

First, while learning recognize the tricky learning curve and keep poking at complex material as you learn. Macros especially feel dense and frivolous before you see them in action. I'd suggest On Lisp both for being full of excellent examples and free. If you're looking at Scheme, then keep SICP by you at all times.

Secondly, more so than in other languages, code to learn. Lisp's parentheses are a turn off to everyone until they reach some critical mass of application and understanding.

Learning Lisp reminds me of learning Chinese: the very medium you write with is vastly different from the norm and rather complex, but as you get into it you learn that there is a whole lot of sense to it.


I would also suggest keeping the Scheme spec, R5RS, around too.


I happened to learn it bottom-up. One day when I was in college, I picked up a book about implementing a Lisp interpreter in C. I knew C, Pascal and Fortran back then, but nothing about Lisp except it's a language for AI with full of parentheses. I was more curious about writing-an-interpreter-in-C part rather than Lisp itself. At home I typed the C source into my 386 DOS machine, and immediately fascinated by how the simple fundamental idea enabling such a rich language. (The book is in Japanese and I think out of print. Probably there are similar books in English, though I don't know).

Then I went on to reading existing Scheme/Lisp implementations and start hacking it. Aubrey Jaffer's SCM gave me a good idea of run-time data representations of Scheme and a simple mark-sweep GC. I learned how to compile Scheme code by looking the output of Joel Bartlett's Scheme->C. STk (now stklos) showed the power of CLOS-style metaobject protocol by mapping Tk protocol to Scheme object cleanly like a magic. Other implementations I looked at was T, VSCM, Scheme48, ...

I also started writing tools I use at work in Scheme. Solving real problems is, after all, the best way to learn the language.


There's a great article on learning Haskell by writing a Scheme interpreter:

http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutoria...


The book, "The Little Schemer" is the absolute best and fastest way to break your mind of its old habits and get into lisp programming. Try to write each piece of code before looking at the answer. (Use PLT Scheme.) Afterwards, your freshly broken mind will be ready for all the other concepts that are also important to lisps.

"On Lisp" is great whether you go with Common Lisp or Scheme. I actually tried to learn Common Lisp from scratch with that book, and I slowly slogged my way through five chapters. I got a lot out of it but it would have been better had I learned what car, cdr, mapcar, etc. meant first. Maybe you could try that.

Any time you can get away with writing something in Scheme (or CL, whatever) do it. Just code with it all the time.


I'm no expert, but I thought I'd add that The Little Scheme is a most enjoyable way to get into Lisp.

I don't think it's that important that you use DrScheme (I suppose that's what you mean with PLT Scheme). If you do, make sure the 'language' is set to standard Scheme, not some 'safe' subset. In The Little Schemer, you go from absolute zero all the way to using continuation passing style, motivating and deriving the Y Combinator, and writing a metacircular evaluator.


Honestly, you don't even really need to have an immediate need to use an implementation to at least start using s-expressions. I put lisp in my C comments and debugging output. //(summary myfunction "the function does this")

It's still readable, and if I ever want to parse out the comments and do anything with it, it'll be easier.


In my case, none of the previously mentioned books. Too complex, with too many assumptions about what you know.

Specially PCL, it helps to feel several 'whoaaa lisp can do that!' moments, but not really to learn the small basic things that are common in lisp.

Instead, I learnt with COMMON LISP: An Interactive Approach downloadable for free here: http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro/Commonlis...

It takes your hand and teaches slowly, but with a solid foundation. If you do al exercises (and you should), you will implement one or two of the very complex projects showcased in On Lisp, but with the difference that you will understand the code from top to bottom (since you wrote it).

Take into account that I have not read "The Little Schemer", so take it out from the list of lisp books I criticise.


I picked up the language after running sawfish as a window manager. This took me to emacs and from there to Common Lisp. I can highly reommend 'A Gentle Introduction To Symbolic Computation' if you are new to programming and 'Practical Common Lisp' if you aren't new to this field. If you follow that up with 'On Lisp' and (optionally) 'Lisp In Small Pieces' you cant go wrong.


Right now, for fun, I'm reading Practical Common Lisp, The Little Schemer, and ANSI Common Lisp. I pick up the book nearest me whenever I have the chance :). I would say it's working well enough for a spare time activity.

Practical Common Lisp is available online here: http://www.gigamonkeys.com/book/


I approached it by following my guru's advice, after having fun with Python, OCaml, Erlang; learing Lisp was pain first and then fun. Paul's book explained a lot, as well as Successful Lisp. And yes, browing HyperSpec a lot makes sense!


Started by writing Emacs-lisp stuff, then read more about it and got to learn Scheme and started using it for projects, finally wrote a Scheme compiler, lost interest and switched to Python :)


There was a book by Hofstadter (of Godel, Escher, Bach fame) which has a nice introduction. Perhaps the book was called Metamagicum.


Are you referring to Metamagical Themas? That book is a collection of columns he wrote for Scientific American, and only a couple of those have anything to do with Lisp.


Yes, I refer to those. They have been my first contact with Lisp. The Wizard Book (SICP) was useful later on.

I did only remember the German title (Metamagicum). Thanks for finding the English one.



I recently did this, as in about a month ago, I became interested in learning Lisp. I started with a bunch of things. First I tried to get various working environments going like:

Emacs + Slime + SBCL

Emacs + Quack + PLT Scheme

I also tried DrScheme (which is a great learning environment).

Not knowing what i'd really need I also did some searching and discovered a few books:

http://mitpress.mit.edu/sicp/

http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html

http://www.gigamonkeys.com/book/

i also purchased the little schemer. I learned various interesting things from these different sources.

1. practical common lisp was essentially useless to me since i'd already been kind of feeling sold on using scheme and had very little interest in common lisp. what it DID teach me was how datastructures in lisp are created under the hood (or how one might go about implementing them). from this perspective it was very nice and helpful when understading, car, cdr and mapcar. although i wish i'd had a nice example of implementing a scheme in C.

2. reading The Little Schemer, has been the single most satisfying read of my entire computing life. so much so that i bought The Seasoned Schemer and The Reasoned Schemer without hesitation at price. this book will teach you to "think lisp" if you can just make it through the first book you will honestly know everything you need to about the lisp mindset and be ready to actually write useful code and no be shocked or surprised by anything. i can't stress enough how useful this book is READ IT.

3. Teach Yourself Scheme in Fixnum days has been a powerful reference for me and I honestly hope that it grows and evolves, it's easy to reference and great for when you start actually hacking on projects. It's just simple and obvious.

4. SICP is a mammoth work and also has a very nice video series. If you're serious about Lisp and even more serious about Scheme and furthermore serious about computing. You must read this. My approach so far has been to read top down (ie. cover to cover) and also use it as a reference. I get sheer joy from reading it, but it's amazing how practical it can be as well.

Personally I've settled on scheme, i dont' really like common lisp i find it irritating and with projects like Chicken: http://www.call-with-current-continuation.org out there I feel really comfortable. I re-wrote my entire blog using nothing but chicken and the web-scheme egg. I recently wrote an irc bot for fun during a huge bot writing session that broke out in a channel i frequent (don't ask we all just started writing bots for some reason).

If you're looking for good platforms the best I can recommend are:

SBCL (hands down nothing really compares so far)

PLT Scheme (aka DrScheme if you like GUI's)

Chicken (the absolute best imho BSD licensed scheme)

Hope this helps everyone. This is such an awesome thread i hope it continues for awhile.


First I'll tell my story to answer the question, then I'll put resources mentioned in a list at the end.

I've been picking up bits and pieces, and would not call myself anything near an expert. I knew what Lisp was from a Languages class in college, and we actually used lisp to implement a language. Roughly none of it stuck, except for car, cdr, and the idea of using prefix notation and the 'everything is an expression' idea.

Relearning it started with just reading PG's essays and getting curious. Being too lazy to order it online, I looked in every bookstore and library I encountered for ANSI Common Lisp, but never found it. It's rather pricey, too, which is why I was hesitant.

I started with SICP and the video lectures. Something important came up in another part of my life, though, and I basically put Lisp on hold for several months.

When I finally got settled down again, I started playing with with emacs-lisp. I knew emacs would be useful no matter what happened next. I downloaded the manual (which is dense) and scrounged for tips on the internet. The idea was that I'd get familiar thinking in that style and using it for practical things, before moving on to something more serious. Emacs-lisp has some limitations (no closures, for example), so it wasn't too long before I started looking elsewhere.

My next two sources were On Lisp by Paul Graham and Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp by Peter Norvig. Both books include speedy overviews of Lisp, and point you to Guy Steele's Common Lisp The Language (2nd ed) (CTL2), which can be found online, for authoritative reference. Both books are good because they are exciting and fun. Norvig has a fairly gentle introduction, while Graham assumes you're already familiar with many Lisp operators. I don't actually think that's a big problem, and you shouldn't let it scare you away from at least trying to read it. I think it's easier to read the first few chapters of On Lisp first and get excited about looking up the details, than it is to slog through a reference or a mundane introduction beforehand.

I've set aside Lisp again, (though I'm keeping my eye open for opportunities to use it), though I have obtained a copy of ANSI Common Lisp which I also highly recommend. Even if you don't need the introduction, the book includes a large reference section that's a bit more 'user-friendly' than CTL2. The last significant reference I've used is Practical Common Lisp by Peter Siebel, which can be found online.

On Lisp, by Paul Graham http://www.paulgraham.com/onlisp.html

Paradigms of Artificial Intelligence: Case Studies on Common Lisp by Peter Norvig

ANSI Common Lisp by Paul Graham

The GNU Emacs Lisp Reference Manual: http://www.gnu.org/software/emacs/manual/html_mono/elisp.htm...

Practical Common Lisp by Peter Siebel http://www.gigamonkeys.com/book/

Common Lisp the Language: 2nd Edition by Guy Steele http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/a...

Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman with Julie Sussman http://mitpress.mit.edu/sicp/full-text/book/book.html


Everyone beat me to the punch, but my starting list for Common Lisp is:

1. A Gentle Introduction to Symbolic Computation. http://www.cs.cmu.edu/~dst/LispBook/index.html

2. Practical Common Lisp http://www.gigamonkeys.com/book/

3. ANSI Common Lisp http://www.paulgraham.com/acl.html

4. On Lisp http://www.paulgraham.com/onlisptext.html

5. Paradigms of Artifical Intelligence Programming http://norvig.com/paip.html

6. Lisp in Small Pieces http://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/d...

SICP is also amazing...and there are at least three sets of videos to go with the book (Abelson/Sussman and HP/MIT, ArsDigita, and UC-Berkeley.)


For Scheme:

1. How to Design Programs [ www.htdp.org ]

(1.5) I've heard good some good things about using Concrete Abstractions or Simply Scheme before SICP...

I know Simply Scheme introduces some non-standard functions, though. I've only glanced at both, so I can't give a full recommendation yet. I just ordered them both in hard copy. These two are probably only useful if you're still new to programming and want to gain more confidence before moving on to SICP.

http://gustavus.edu/+max/concrete-abstractions-pdfs/index.ht...

2. Structure and Interpretation of Computer Programs [ Buy the book and check out all three sets of videos...the instructor's manual is pretty much a waste of $, though, IMHO. ]


From R5RS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: