Common Lisp isn't really that functional. If you don't want a purely functional language, you should at least go with Scheme.
If you just want to learn functional programming, I would suggest Haskell. Scheme and CL are great for other reasons.
Name:
Anonymous2011-12-25 13:14
>>3
So, between Common Lisp and Scheme, which one should I pick? I've heard that Scheme is basically Lisp with a reduced standard library.
Name:
Anonymous2011-12-25 13:35
Well, learning functional programming can get a bit involved.
The first two chapters of SICP deal with the basics of functional programming, employing Scheme. It's very bare-bones, using only function definitions, variable binding and anonymous functions. You can use those constructs in almost any modern language (yes, that means that Java isn't modern), though poor language design or excessively imperative standard libraries can hinder your use of them.
In Haskell you get a pattern matching, list comprehensions, a nice type system, built-in and fancy ADTs, though at least the first two you can get as libraries in any Lisp dialect. I can't comment much more, I'm still learning from the official tutorial and Learn you a Haskell.
I'd go with Scheme first, and Haskell second, even if it's just to get a taste of a state-of-the-art language.
>>5 Scheme is basically Lisp
Well, that's because Scheme is a Lisp. If you meant CL, no, they're like C and Java: similar syntax, completely different languages.
Scheme is cleaner, Common Lisp is ENTERPRISE-QUALITY.
But if you want pure functional programming, choose Haskell, if you don't care about purity, use an ML (are they still a valid choice, right?).
If you want a Lisp, pick whatever. Scheme encourages functional style.
CL isn't really functional, but you can write functional code in it without problems, it just depends on what style you prefer - CL doesn't force you into any particular style, you're free to choose. Scheme tries much harder to make it more likely you end up writing functional code, but doesn't force you either.
Haskell is purely functional.
less weird syntax
Lisp's syntax is fairly simple compared to Haskell's, but Haskell's syntax looks more 'natural'.
You should probably read SICP (which teaches you programming and uses R5RS Scheme, without macros), and eventually try your hand at CL (read Practial Common Lisp if you want a simple introduction with examples). If you end up prefering Scheme and want to use it for more practical programming, you'll end up using some popular implementation like Racket which provides many extensions/libraries. If you end up prefering CL, you can use the wide majority of implementations (such as SBCL, ClozureCL, ECL, CLISP and so on) as they follow the same standard and libraries tend to work interchangably (except those which are highly unportable, but most of them have compatibility layers which allow them to work with most implementations).
You should also learn ML or Haskell as well as they have their own unique lessons to teach which are not obvious in languages which are not staticly typed.
>>1
It really doesn't matter what language you use, to be fair. However, I'll recommend CL, though it isn't really functional. Don't expect your brain to conform to the CL syntax in a day if it has been molded by the curly-brace way of doing things. Give it a week or two.
Read Practical Common Lisp. Reread it - mostly because the chapter organization is pretty strange for a beginner, IMO. Read ANSI CL. Learn to disregard smug Lisp weenie-ism, unless you're into that kind of thing.
>>16
To be fair to CL, it doesn't force implementations to implement TCO(tail call optimization) in the standard, while Scheme does(to allow removing a lot of imperative constructs from the standard), however in practice most CL implementations do implement TCO, and it's a matter of which style you prefer (more functional or more imperative).
OP here. I tried SICP but it's too beginner oriented. Then I looked at Practical Common Lisp and I'm finding it quite enjoyable. I'm going to postpone Haskell for now.
So, New Year's resolutions list:
* Finish Practical Common Lisp.
* Write some application using CL.
* Learn some motherfucking Haskell.
>>24 Fuck that, I already graduated.
And you haven't learned a functional PL? What did they teach you, Enterprise Applications in Oracle®'s Java™?
Name:
Anonymous2011-12-26 13:01
>>27
Hey, they teach us Enterprise Applications in Oracle Java here at San Francisco State University! I wanna let you know they we have an army of small no name firms seeking us CS for IT support jobs.
Name:
Anonymous2011-12-26 13:03
>>28
Being a software engineer at Google or Facebook is nothing compared to the following...