Question

F# vs Haskell vs Lisp - which language to learn?

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?

 45  28506  45
1 Jan 1970

Solution

 46

F# is my language of choice, but I'd strongly recommend learning them all. They are all quite different and interesting in their own right. Here'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 makes 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 comprehensions. It also has OO and imperative features and good access to libraries, since you can use any .NET framework component.

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

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

2010-02-10

Solution

 29

I had the same question once

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, tuples, 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.

2010-02-10