views:

338

answers:

7

I have been working as a C developer on Linux platform for sometime now. Recently finished K & R and did a little study of implementing OOP in C. Beside that I have studied C++ and Java. All of it has been on Linux platform.

Now I plan to learn LISP. I have gone through LISP discussions directed towards beginners on SO, especially What’s the best way to learn LISP.

I understand, moving from procedural to functional programming paradigm is a big move. Thinking in terms of the new paradigm would be the real challenge. Just like the way it was when I learned OOP for the first time.

It is the paradigm I am really worried about. When I started OOP, most of the time was consumed in learning how to view problems in terms of OOP. Syntax was not so difficult to grasp.

Now as I have been working in C, my current projects at my workplace are also in C. I am concerned how could I learn to view problems in terms of functional programming.

  1. What could be the best way to make shift towards LISP for a C developer?
  2. Should I learn some other intermediate language before I move to LISP?
  3. If yes then which language that could be?
  4. Any particular text that would help me think in the way of functional programming?
  5. Any suggestion that would make this shift faster and easier?

Thanks for your time. Any help and suggestion would be greatly appreciated.

+6  A: 

Possible duplicate

You could do a lot worse than MIT Course 6.001 "Structure and Interpretation of Computer Programs". The class uses Abelson & Sussman's text; see also the book's main site for more information.

The class uses Scheme, a dialect of LISP which is significantly cleaner and easier to use than Common LISP (yes, this is an opinion, deal with it). Switching to Common LISP won't be that difficult later. Paul Graham's On LISP is a "take no prisoners" text on programming in Common LISP. His ANSI Common LISP is a gentler introduction to the subject.

Now for the bad news. Making the shift toward WORKING in LISP is likely to be very difficult, as there are a lot more C/C++ and Java jobs out there.

I'd recommend jumping straight into learning LISP. It isn't that difficult.

You'll need a LISP system to play with. If you are using Scheme, it is hard to beat the MIT/GNU Scheme system. For Common LISP, there are several choices: I'd probably start with GCL - GNU Common LISP. Versions are available for Linux and Windows.

John R. Strohm
@John: First of all thanks for answering to my question. English is not my native language, so would you please explain what do you mean by `You could do a lot worse than...` You mean if I don't read this book I would do worst? As for duplicate link, I have already mentioned it in my post. Thanks.
Andrew-Dufresne
English idiom. It means that you could do it some other way, but it would likely be a lot more painful if you did. Course 6.001 taught LISP to a very large number of MIT freshmen engineering students, with relatively few casualties. The link is to the MIT Open Courseware site, and contains the complete class, not just the textbook.
John R. Strohm
GCL is totally outdated. Use SBCL or CCL.
Rainer Joswig
+1  A: 

I found python foundation (lambda functions and such) to be very helpful in grasping lisp.

At one time I decided to learn emacs scripting, which uses lisp dialect, and that was very helpful, since then you know you want what to do, instead of going through exercises.

I think you need a good text editor with lisp support and shell. then just try to make a target project and implement it.

aaa
+1  A: 

I personally found the GNU Emacs Lisp Tutorial a delight to read. It will give you the general ideas.

PP
+8  A: 

Try the books:

Practical Common Lisp by Peter Siebel (available online at http://www.gigamonkeys.com/book/ ).

ANSI Common Lisp by Paul Graham then try On Lisp by the same author.

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

Other places to find help include the #lisp channel on FreeNode and LispForum ( http://www.lispforum.com/ ).

Of these PCL is probably the easiest to get into, if you're trying to learn Lisp as a way of learning Functional Programming you're going to be disappointed though, you can use Lisp to do FP but it isn't strictly a FP language.

Amos
+1 for Practical Common Lisp.
Svante
+3  A: 

The book I originally learnt lisp with is The Little Schemer by DP Friedman. Really gets your head into a functional programming mindset.

Giles Roberts
+1  A: 

I recommend first reading Successful Lisp up to chapter 3, don't go on and read chapter 4. 3 get's a good grasp of Lisp thinking, however. Then read Gentle, and after that, Practical Common Lisp. From there, just general Common Lisp experimentation will help you on from there.

Alex
@zc00gii: Thanks. From `Successful Lisp`, you mean this [book](http://psg.com/~dlamkins/sl/). What is the complete name of the book `Gentle` that you have mentioned? [Common Lisp: A Gentle Introduction to Symbolic Computation](http://www.cs.cmu.edu/~dst/LispBook/)?
Andrew-Dufresne
correct. Glad I could help :)
Alex
+2  A: 

Read "Practical Common Lisp". At my company we have at least 70 programmers using Common Lisp every day for complex, practical programs (airline fare search, airline reservation systems), and when a new programmer shows up who is not familiar with Lisp, we just hand him or her a copy of "Practical Common Lisp". I cannot say enough about how great this book is.

Dan Weinreb