Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been programming for years now, working my way through various iterations of Blub (BASIC, Assembler, C, C++, Visual Basic, Java, Ruby in no particular order of "Blub-ness") and I'd like to learn Lisp. However, I have a lot of intertia what with limited time (family, full time job etc) and a comfortable happiness with my current Blub (Java).

So my question is this, given that I'm someone who would really like to learn Lisp, what would be the initial steps to get a good result that demonstrates the superiority of Lisp in web development? Maybe I'm missing the point, but that's how I would initially see the application of my Lisp knowledge.

I'm thinking "use dialect A, use IDE B, follow instructions on page C, question your sanity after monads using counsellor D". I'd just like to know what people here consider to be an optimal set of values for A, B, C and perhaps D. Also some discussion on the relative merit of learning such a powerful language as opposed to, say, becoming a Rails expert.

Just to add some more detail, I'll be developing on MacOS (or a Linux VM) - no Windows based approaches will be necessary, thanks.

Notes for those just browsing by

I'm going to keep this question open for a while so that I can offer feedback on the suggestions after I've been able to explore them. If you happen to be browsing by and feel you have something to add, please do. I would really welcome your feedback.

Interesting links

Assuming you're coming at Lisp from a Java background, this set of links will get you started quickly.

  1. Using Intellij's La Clojure plugin to integrate Lisp (videocast)
  2. Lisp for the Web
  3. Online version of Practical Common Lisp (c/o Frank Shearar)
  4. Land of Lisp a (+ (+ very quirky) game based) way in but makes it all so straightforward
  5. Install Clojure and Sublime 2 on MacOS an excellent getting started guide
  6. Look at the Clojure in Action book. Worked for me.
share|improve this question
14  
How to start with Lisp: open as many parentheses as you can. –  mojuba Nov 24 '10 at 11:18
4  
... and when you fully grasp it all then you just close them off? I see. :-) –  Gary Rowe Nov 24 '10 at 11:24
2  
On Lisp rocks (I've not read ANSI Common Lisp), but as an intro book, Practical Common Lisp > On Lisp. IMO, at least. (I read On Lisp first, but PCL was what got me into CL.) –  Frank Shearar Nov 25 '10 at 14:42
2  
You will need to get into great physical shape before you should attempt it. –  Job Nov 27 '10 at 17:46
2  
@Job Did I mention that I'm also training for a sub-ultra marathon? –  Gary Rowe Nov 27 '10 at 18:14
show 6 more comments

9 Answers

up vote 13 down vote accepted

This is probably counter to most peoples' recommendations, but steer clear of Emacs to start with, unless you already know it. Especially if you're used to modern IDEs/editors.

I'm speaking from experience; I tried to start with Emacs, but having to learn the language AND the editor at the same time really frustrated me (especially since Emacs is so different from other tools). I ended up chucking it, getting started with PLT Scheme (now Racket) which comes with a comparatively simple cross-platform IDE, a centralized package repository and fabulous docs (including an intermediate tutorial specifically aimed at web development). After I got a clean grip on Lisp, I ended up going back to Emacs, picking up EL/CL by way of Practical Common Lisp and Xah's Elisp Guide. Basically, as I see it, you need to know a Lisp before you can use Emacs effectively, and you need to know Emacs in order to be very effective with CL/Elisp. This means that you can either pick up Scheme, or learn Common Lisp through some other editor first (LispWorks personal, probably).

If you already know Emacs, then yeah Elisp is the natural step (though how you would enjoy Emacs use without knowing Elisp first is beyond me).

YMMV of course, this is just what I found helped.

Since your current blub is Java, you could probably get a lot of mileage out of Clojure, Armed Bear or Kawa. I haven't tried any of them myself, not being a Java guy, but Clojure specifically comes highly recommended from other Lispers I know. It seems like the ability to keep your current VM and IDE might help with the learning process.

share|improve this answer
    
I already had some basic fluency in emacs when I started. Emacs does have a very steep learning curve! –  Frank Shearar Nov 26 '10 at 8:03
3  
@Thorbjørn Ravn Andersen - Did that. Twice. Still found myself constantly using CUA shortcuts (which are off by default in Emacs). The worst was closing my editor with an accidental cut + intended copy (C-x C-c). I love Emacs to death, and pretty much live in it now, but realize that at first, you're fighting years of muscle memory telling you C-s is Save, not Search and that Undo is C-z. I won't recommend that kind of frustration to someone whose intention is learning Lisp. Learn the language first, realize you love it, then start fighting your hands with a clear goal in mind. –  Inaimathi Nov 26 '10 at 12:33
1  
@Inaima, well power comes with a price, and the Emacs bindings predate CUA so blame IBM :) Also Ctrl-C + Ctrl-v isn't CUA :) –  user1249 Nov 26 '10 at 15:25
2  
And another +1 (if it were possible) for recommending Racket, great IDE, great documentation, great packages! –  systemovich Dec 12 '10 at 14:20
1  
@Geoffrey van Wyk - PLT is great to start with, but there are some limits you run into after a while that made me switch over to CL/Emacs once I had my bearings. YMMV. I did a write-up a while ago, if you're interested in details langnostic.blogspot.com/2010/09/… As far as the LispWorks question; I have to believe that they're targeting large teams (where the company buys the tools) or consultants (who usually make enough that the price tag is justified). Not sure how it's working out for them, but it's not the approach I would have picked. –  Inaimathi Dec 13 '10 at 12:26
show 5 more comments

To get a good basic introduction to the language, read Peter Seibel's Practical Common Lisp. The book's excellent.

Setting up emacs and SLIME can be tricky for a newbie, where "tricky" varies in magnitude depending on your OS. As usual, Windows gets the short end of the stick, but people have done the hard part and written it up (SBCL, Emacs, SLIME).

Once that's out the way, Planet Lisp referenced an article recently describing how to set up Hunchentoot and nginx.

OS-specific edit: MCLIDE might be a good place to start. I installed it, but haven't had the chance to actually use it, so I can't say anything useful about it. It certainly looks interesting!

Edit: Eclipse has the Cusp plugin, too.

share|improve this answer
    
+1 for the book recommendation. I've edited the question to target the OS in light of your answer. –  Gary Rowe Nov 22 '10 at 13:42
    
Thanks for the IDE recommendation too - I'll check it out. –  Gary Rowe Nov 22 '10 at 14:44
    
Thanks for the IDE recommendation. Slime is all borked up on my Mac mini. Now I may not have to fix it. –  Larry Coleman Nov 23 '10 at 13:54
    
Just spotted your edit regarding Cusp - I'll check it out. I didn't have much success with MCLIDE but that may be because I'm too used to Intellij and Eclipse. –  Gary Rowe Nov 29 '10 at 23:19
add comment

If you'll be developing on a Mac, you may want to try Clozure CL. It comes with an IDE that has Emacs-compatible keystrokes, and there's a bridge to Objective C so you can write Cocoa applications.

Also, I've read Practical Common Lisp, but found Successful Lisp to be helpful as well.

Finally, some patience on your part will be rewarded. Productivity and minor victories will come pretty quickly, but the big win may take a while.

share|improve this answer
    
+1 for the Mac IDE recommendation. I'm not so bothered about Cocoa applications (but thanks anyway, it may help others). –  Gary Rowe Nov 22 '10 at 14:10
add comment

Conrad Barski has a great tutorial called Casting SPELs in Lisp (SPEL is his acronym for macros). It involves making a simple Adventure-type game, and jumps right into Lisp macros. He also has been working on an introductory book that is now available at:

Learn to program Lisp, one game at a time.

And, from the Table of Contents:

  • Create your own web server, and use it to play browser-based games

I don't know what this implies for web development (as in HTML pages) using Lisp, however. :)

Update - I see someone mentioned the book "Structure and Interpretation of Computer Programs", which reminded me that MIT has put online, the entire SICP Video Lectures by Hal Abelson and Gerald Jay Sussman. You might have found the book dry, but the lectures are excellent. Although they're Scheme-based, they still get across the basic concepts also in Lisp, very nicely. Well worth downloading and watching.

share|improve this answer
    
+1 for an interesting approach - I'll take a look –  Gary Rowe Nov 25 '10 at 15:08
add comment

A very nice place to start using Lisp is inside the Emacs editor, where it can be used to redefine just about anything. You want the 'e' key to insert the time of date, just write a small Lisp snippet to generate the string and bind it to the e key. Done.

This will also allow you to actually USE what you learn in a daily setting, if you happen to use a plain editor during the day.

share|improve this answer
    
+1 for the "use what you learn" advice. I'm an Intellij bod for the day job, but I just might be able to get my paws on emacs in our very restricted software environment. –  Gary Rowe Nov 25 '10 at 20:17
    
@Gary, if you have a Linux box around it most likely has Emacs (or can get it very quickly). –  user1249 Nov 25 '10 at 20:18
    
@Thorbjørn It's more a case of actually being able to install it. –  Gary Rowe Nov 25 '10 at 20:24
    
The Windows port of Emacs is a zip file to unpack. (and perhaps a single EXE to run to register). I think success is realistic. –  user1249 Nov 25 '10 at 22:11
2  
@Gary, for Java Clojure runs as a jar in your IDE. –  user1249 Nov 26 '10 at 9:15
show 6 more comments

I have a copy of ANSI Common Lisp right here by my desk. I pick it up every couple of years and get a couple of chapters through, then get stuck on a couple of exercises and it slips down the priority list. That probably tells you more about me than the book though. The book seems entirely competent...

share|improve this answer
    
Maybe reading through the answers and comments to this question will give you the impetus to work towards a higher goal. Have a crack at the PCL link and tell us what you think... –  Gary Rowe Nov 26 '10 at 9:06
add comment

Another commentor, Inaimathi, recommended this book a few days ago: The Little Schemer

Received it today and I can say as someone who has a very hefty library of programming books acquired over many years, that I may have only read one chapter, but I will definitely need a hardback version of this. It reads like the Tao Te Ching, lots of little snippets of divine wisdom regarding the language. It may say Scheme, but it was originally called "The Little LISPer", the languages at the level it discusses are sufficiently similar to be taught as one.

It is not an advanced text, but has a mission to instil the principles of the language and what it is really for, how to think like it. I believe it would be an excellent starter to LISP.

NB. The Programmer Competency Matrix actually mentions this book in the top level of competency of things to look for. (see Books section)

share|improve this answer
    
+1 for the programmer competency matrix link (must go off and read some more theory...) –  Gary Rowe Nov 26 '10 at 15:40
add comment

Well,You can hit two birds by reading SICP ;One is learning LISP(i mean scheme is a dialect of Lisp) and other is great insight into how to program.Period!!

share|improve this answer
1  
+1 for the link - a quick scan through seems to show that it's very detailed but also rather dry (read academic) in it's approach. I'm a big fan of "the experts voice" coming through when reading text but it seems like a good overall reference. –  Gary Rowe Nov 26 '10 at 9:29
add comment

Already a lot of great answers, but assuming you want to dive head-first into web development with a Lisp, I have a few more ideas.

Clojure is the first Lisp I've seen to have really excellent full-stack web frameworks that are ready for prime-time.

  • Noir is a solid web framework with routing, templating, etc., similar to Sinatra but a bit more feature-rich. It uses Ring, which is basically Clojure's equivalent of Rack in Ruby.
  • Korma is a SQL abstraction library that pairs really well with Noir.
  • Pinot is a client-side framework written entirely in ClojureScript, which brings us to:
  • Clojurescript is a compiler for Clojure which targets Javascript.

If you hadn't noticed, I just covered the entire web stack and it's all written in Clojure.

I find Clojure a bit easier to get started with then Common Lisp, with far better feature set/library support than Scheme.

If you're coming from a Java background at all, it has the added benefit of running on the JVM, which gives you access to the whole Java stdlib when you need it.

The available documentation isa work-in-progress, as are the frameworks themselves. But there's a pretty good tutorial right here.

As far as editors go... if you're comfortable with vim, you can use vim with SLIMV. If you like emacs, emacs/SLIME is okay. There's pretty good Eclipse and NetBeans support for Clojure (or so I'm told), but I generally use TextMate (although Sublime Text 2 is quickly becoming my editor of choice). I know I'm missing out on a little Lisp magic not using a more integrated environment, but I'm happy to hit ⌘-Tab to swap between my editor and REPL; your mileage may vary.

If you want a book to jumpstart you, I recommend Programming Clojure by Stuart Halloway and Aaron Bedra. The 2nd edition just came out from PragProg, so it's up-to-date.

Happy Lisping!

share|improve this answer
1  
+1 for the ClojureScript reference - very neat. –  Gary Rowe Jun 5 '12 at 14:37
1  
+1 for Programming Clojure. I think it's a great book both for introducing Lisp and for learning Clojure. –  faif Jun 5 '12 at 19:52
    
You might want to add Leiningen –  Gary Rowe Jan 9 '13 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.