tags:

views:

1702

answers:

7

I've heard a lot about functional programming languages and I'm willing to learn one. I guess it will be mostly for fun, however, I hope it will improve my programming skills.

I have mostly C#/.NET background, so my first choice is to learn F# (because of .NET and familiarity with Visual Studio). On the on other hand, I wonder if F# has features like Lisp macros or Haskell higher order functions.

Could you compare F#, Haskell and Lisp? Which one will be the language of your choice?

+5  A: 

Currently I'm watching these video's on Channel 9 on the basics of Functional programming. It's explained using Haskell, but the basics apply to all languages. I must say it's very informative and easy to understand.

Tony
+7  A: 

I had the same question once

(and posted it too : Which functional programming language should I use?)

Since then, I have done some programming in F#. Now I am very glad I did, since it is realy helpful to understand LINQ in C# and that happened to be my background too. (I almost never use foreach in C# now since I learned F#)

I learned through F# a lot of things about lazy evalution, lists and sequences, all of which you could pick any language for with good support for lists, tupples, and so on (like any functional language I guess), but if you pick F#, all of this will be very useful in C# too. Maybe you already know all of this stuff and use it right, but in case you don't, pick F#.

I started out here : a very nice video tutorial, very impressive and a very inspiring tutor.

Peter
that video is an excellent introduction to the power of F#
ecounysis
+10  A: 

F# is my language of choice, but I'd strongly recommend learning them all. They are all quite different and interesting in there own right. He's a quick over view to each one (with perhaps a slight F# bias), you can easily find more info by googling:

F# - is a language that make it easy to program in the functional style, lets you easily copy objects rather than mutating them. It also gives you interesting data types, like tuples and algebraic data types, useful language constructs such as pattern matching and list comprehnsions. It also has OO and imperative features and good access to libraries, since you can use any .NET framework component.

Haskell - is pure and lazy functional language, making a rare or even unique beast. This mean there are no side effects at all, unless they are tracked by a monad. Haskel too has tuples, algebraic data and pattern matching.

Lisp - where as F# and Haskell are statically typed, lisp is dynamically typed. It has distinctive syntax which uses lots of parenthesized and provides an interesting marco feature that allows you to make transformations to the program itself and extend the syntax.

Robert
In Haskell, there are more ways to track side effects other than monads, such as arrows and applicatives.
Martijn
+4  A: 

This is a very subjective question.

My opinion is that Scheme (a Lisp variant) and reading SICP is the right thing. You will learn a lot.

But for practical purposes and if you are a .NET developer then maybe F# is better.

Arve
And Clojure (Lisp) for a JVM developer.
jetxee
+2  A: 

Why choose? Learn both Lisp and Haskell on your own. No point in learning F# on your own time though. If you need it for work, you'll learn it at work ;)

EDIT: The guy was looking at language to learn for fun. Well, Lisp and Haskell are good candidates since fun is all they are going to be used for (no paid jobs there). He "might" (although unlikely) have opportunity to use F# at work (he is in MS shop), so why learning something in free time when he can be paid learning it at work.

Dev er dev
"No point in learning F# on your own", what???
Bruno Reis
No jobs? Someone should tell http://lispjobs.wordpress.com/ so they can shut down the site. ;)
mipadi
+4  A: 

I learned all of them to a diffeent degree, and would advise starting with Scheme (a Lisp dialect) - simply because it is easiest to learn. Haskell and F# are statically typed, which is a big advantage for real-life projects, but IMHO they have a little "too much" syntax and are not as easy to pick up as Scheme.

There is a nice Scheme implementation for .NET - IronScheme. You can take a look at my article "Playing with IronScheme" to see if you like it.

Nemanja Trifunovic
+1  A: 

I don't know F# but I like to play with it sometimes. My language is Clojure with is very functional and works on the CLR to but the jvm version is the main version.

It overs you a lot of the stuff you want. The main diffrence to F# is that Clojure is dynamicly typed and it has really good way handle conccurncy (one of the best I would say).

Btw. Did you know that F# was made because Haskell was to hard to get running on the CLR? (Thats not the hole story of course but its part of it)

nickik