views:

1280

answers:

7

I'm currently learning Haskell, Which language (F# or Haskell) do you prefer for programming general purpose applications?

Which do you think is the stronger language?

+7  A: 

It depends what you want to do:

Haskell is the more purely functional language of the two.

F# is more of a hybrid language, and not purely functional, but has a great set of base class libraries that you can use to do modern things easily on Windows or Mono.

Brian R. Bondy
F# also works on Mono.
TraumaPony
But thats with a different platform, he doesnt deserve a downvote.
Rayne
F# is a language for the CLI; therefore, it's the same platform.
TraumaPony
thanks guys, fixed description.
Brian R. Bondy
+8  A: 

I'd say F#, as you can access the entire .Net framework. However, that's more of a library thing.

TraumaPony
+2  A: 

I'd say it depends on why you are learning it. If you are doing it for the experience of a pure functional language, go for Haskell. But if you are definitely going to use the language for more than that, F# is might be the better choice.

David The Man
+14  A: 

I'd go for Haskell. HackageDB is a great collection of libraries that are written specifically for the language. In the case of F# you'd have to use mostly libraries that are not written with a functional language in mind so they will not be as 'elegant' to use. But, of course it depends largely on how much functional programming you want to do and constraints of the project you want to use it for. Even 'general purpose' does not mean it should be used in all cases ;)

eelco
+5  A: 

You might find this blog post by Neil Mitchell informative:

F# From a Haskell Perspective

The comments are also illuminating.

daf
Neil begins by stating that he knows very little about ML and then draws several flawed comparisons between F# and ML, concluding that F# inherits its flaws from ML. That is just worthless nonsense. If you want to know about ML, ask someone who knows ML (i.e. not Neil).
Jon Harrop
+19  A: 
Curt Sampson
All fair points. I think Windows Presentation Foundation is an obvious counter example in the context of libraries though: it is far better designed and more powerful than anything available from Haskell (e.g. Qt). I would also advise technical users to seriously consider switching platforms just to use F#. I prefer Linux to Windows but .NET is just so far ahead of anything available on Linux or Mac OS X now...
Jon Harrop
+5  A: 

I think Jon Harrop has a serious downer on Haskell for some reason. It's simply not true that it is not used outside of academia in fact it is widely used in investment banking and far more so than F# and OCaml are and for good reason. If you want a job functional programming then learn Haskell as there are far more posts advertised for Haskell programmers than F# or OCaml. I'm sure F# will gain popularity as it has Microsoft behind it and it is starting from zero but at the moment Haskell has a clear lead.

Probably 2 or 3 years ago, OCaml led the field in practical functional languages but since then Haskell has overtaken it with more libraries, more features, better performance and wider commercial use.

Andrew