empi empi - 11 months ago 180
C# 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?

Answer Source

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.