Ask YC: I started learning Lisp and I'm looking for some advice.
I am a graduate with a CS degree. I didn't really get into programming during college, I enjoyed it, but it wasn't my life like so many other students. I now am getting to the point where its becoming my life (in a good way). I feel like I am really behind in certain areas and no matter what I do, I can't seem to break this barrier and step it up to the next level. I was taught C++ in college but haven't used it once since. I got a job as a web programmer and now work using mainly PHP and Javascript.
I have wanted to take my abilities to the next level for some time but I didn't know how. A friend of mine wanted to start programming so we decided to learn a language together. We narrowed it down to Python or Lisp. I am now learning Lisp and enjoying it, but I don't know how to proceed. It seems every time I try to read a book, the basic stuff is too basic and the advanced stuff is too advanced. I'm in this limbo where I know enough to be a successful web programmer, but know almost nothing of real programming. The ramblings in this message should convey how upset I am with myself. I just don't get it.
I need some advice. I can't seem to find basic lisp projects to get me going. I have even tried to find home work problems on the web just to get something. Books seem to go from "here's a loop!" to "here's a bunch of stuff that we have never covered and now we are throwing it in!" I don't know how to move forward.
Any thoughts and advice would be most appreciated.
26 comments
[ 3.1 ms ] story [ 65.8 ms ] threadhttp://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html
I have also heard really good things about PG's "On Lisp" [http://www.paulgraham.com/onlisp.html]. Again, its free to download, so you don't have much to lose to try it.
Hope this helps.
As far as problems to start working on, the best way I've found to learn a language is to start making tools/utilities for myself. Then I'd start learning everything I need to implement that particular tool. Pick a task that you wish was simpler or more automated and write a tool to do that for you.
Personally, I loved learning Scheme (a dialect of Lisp) from from Structure and Interpretation of Computer Programs (http://mitpress.mit.edu/sicp/), and since it's used to teach CS courses, you can find lots of exercises and project ideas online. If you don't mind a slower, more concept-based learning method, you can supplement your programming projects with this book.
Anyway, good luck with your studies, I think the rewards are well worth the effort. I can honestly say no matter how long I've been away from lisp I always find myself going back and loving it even more each time.
The key for me was to have some code of a non-trivial complexity to play with. This would be something that you would be willing to rewrite four or five times and really master. Having an interesting application in mind helps one get there, but one can often flip states between "interesting app" and "interesting problem" in programming.
It's not in vogue nowadays, but Knuth's Art of Computer Programming is chock-full of this kind of "programming exercise" and it makes a pretty good reference too.
To learn "lispiness", functional programming, and get a feel for the computational approach to programming, read The Little Schemer and The Seasoned Schemer. Also watch the SICP lectures (http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-le...) and if you're ambitions, read the book (http://mitpress.mit.edu/sicp/). Doing these things will help keep you from writing PHP in Lisp.
To put it into practical perspective and learn the nuts and bolts of modern common Lisp, read Practical Common Lisp (http://www.gigagmonkeys.com/book).
If you read PCL, you will run into Emacs and SLIME (the generally preferred [NO FLAMES, PLEASE. I KNOW VI IS AWESOME TOO] open source way to edit Lisp files). I wrote some resources to help with that:
http://www.pchristensen.com/blog/articles/public-beta-open-f...
http://www.pchristensen.com/blog/articles/reference-for-the-...
I'm surprised no one has mentioned PAIP (Peter Norvig's Paradigms of Artificial Intelligence Programming). It's half AI book, half tutorial on Lisp programming and Lisp style. It's a good read with lots of example programs written in good Lisp Style.
There are three hurdles people usually run into when learning Lisp:
a) the language looks different - this goes away with practice and familiarity. It starts looking normal fast. The parentheses are a bit tough to manage unless you use a capable editor, which leads to:
b) Emacs is different - really powerful, fun to use, but it takes investment in learning. It's really tempting to quit when starting, but worth getting over the hump. Once you do that:
c) the way of thinking is different in Lisp - Lisp seems a little awkward to use until you get (don't need to master them, just get the idea) the following ideas: 1) code can be manipulated as data because the syntax is so simple, 2) creating your own syntax (using macros - code that writes code) means that you can express your program in a way that closely matches the problem you're trying to solve. Some good articles to help get these points are:
http://www.defmacro.org/ramblings/lisp.html
http://www.defmacro.org/ramblings/fp.html
Don't worry if you don't get these "big picture" things at first, they click at some point and everything makes a lot more sense. You can speed that up by putting a lot more Lisp in your head in the meantime.
Good luck!