views:

1242

answers:

9

NOTE : i don't agree btw this is a double question. Please read carefully. I want to know more than just production/studying. Maybe I should lay another accent then and rephrase it? One of my questions is :

  • for GUI
  • for diff. OS ? Windows?
  • for anything you can come up with: a general positioning of functional languages thus.

I know this is probably a subjective question, still, I'm sure there's a lot that could be said. I'm learning Haskell this moment, and, have to admit, I'm struck by its sheer beauty.

Still, Haskell is only one language, and I have no clue how one functional language differs from te next one. I've came across lots of imperative languages (OO or not) in my life, and I think, as much as the next guy, the imperative languages, COBOL and C# are hardly comparable. If there's that much difference in functional languages, is the choosing of one very relevant to me.

Of course, which language to use is very dependant of the context, I can imagine that the answer on 'Which functional language to use for production code' (any?) as not the same as 'Which language to use to study the functional language principles', so I very much would like some positioning of the different languages. Like which should I use when I need a GUI? Which one have compilers for windows to? Is Haskell 'the' functional language, and so forth...

+6  A: 

Haskell is definitelly one of the choices. You can also try at clojure. It's a lisp, functional, has access to a large amount of java libraries, cross platform, can use swing or swt or qt for gui, ...

Dev er dev
A: 

I think this may be a duplicate of e.g.

http://stackoverflow.com/questions/171719/functional-languages-when-to-use

http://stackoverflow.com/questions/102911/whats-a-good-functional-language-to-learn

Brian
similar indeed, but still differint imo.(One is about what to learn, the other for production, overlapping indeed, and some interesting answers for me too,tx. My question is as general as can be : a general positioning)
Peter
+3  A: 

I would recommend learning F# since it is not only functional, but it also takes advantage of the richness of the .NET framework to allow to use objects where it is applicable.

Scala and Clojure are other functional languages that can also use Objects where applicable.

Jose Basilio
+3  A: 

Take a look at F#. Full support within the next release of Visual Studio and of course you get access to the .NET framework.

Codebrain
+4  A: 

Standard ML and LISP/Scheme are two obvious candidates.

ML is a remarkably clean and well-designed language, very nice to work with, and it differs from Haskell in two main ways: It doesn't have lazy evaluation, and it allows side effects in some cases. F# is pretty much a .NET port of ML.

At my university, first-year students are taught it as an intro to programming.

Lisp or one of its variants like Scheme are always an eye-opener too, although more for its powerful (lack of) syntax than for being functional.

Both are definitely worth exploring if you want to see what diversity exists within the field of functional languages.

For practical use, F# is probably your best bet, given how well it integrates with the .NET class library, which gives it a lot of functionality for free.

jalf
"Integrates with .NET class libary, which gives it a lot of functionality for free"... but it is mutable functionality. And really, how 'well' does it integrate in a large project? I have my doubts. Any citation reports you can give?
nlucaroni
No, I agree with you, from a pure functional perspective, I'd prefer another language too. But he did ask about making GUI applications other "practical" uses. And then simply having access to .NET would be a huge advantage, even if it is mutable and non-functional.
jalf
I agree with jalf's original statement; why a lot of that functionality rests on mutability, can you argue against its productivity? F# isn't a "funtional" language - it's multi-paradigm. You could, for example, use functional as much as you want for your algorithms, and then use .NET to present it.
Tony k
@nlucaroni: look at our products for examples of F# heavily integrated with .NET. Mutability is irrelevant.
Jon Harrop
How does F# prove that mutability is irrelevant?
jalf
+17  A: 

There are a few different axes here you're considering, so here's some scaffolding I hope others may fill out:

Statically-typed (ST) vs. Dynamically-typed (DT)?

Pure (PURE) vs. side-effects (MUT)

Platform/runtime: .Net (NET) vs. JVM (JVM) vs. other?

Intended more for academic (ACAD) or production (PROD)? (This is quite subjective, many "academic" languages have seen commercial and production use, and vice versa)


(please fill in the blanks!)

Language         type      platform    use      gui framework/ lib
----------------------------------------------------------------
Haskell          ST,PURE   other       ACAD     see (*)
Clojure          DT,MUT    JVM         PROD     Swing
SML              ST,MUT    other       ACAD
OCaml            ST,MUT    other       PROD     Tk and GTK
Scala            ST,MUT    JVM         PROD     Swing
F#               ST,MUT    NET         PROD     wpf, winforms
Common Lisp      DT,MUT    other       PROD
Erlang           DT,MUT    other       PROD
<add others>

(*) http://www.haskell.org/haskellwiki/Applications_and_libraries/GUI_libraries

Brian
Very interesting, tx!I thought PURE was a characteristic of functionalLang. but I was clearly mistaking!
Peter
@Peter - Any language with a print() statement cannot be purely functional. In a purely functional language, all functions take arguments and return values - they never have side effects (like printing text to the screen). For example, Lisp's (format t "Hello, world!~%") breaks that rule.
Chris Lutz
Yes, but then again, Haskel is not puter either, as stated above
Peter
Another axis to consider is lazy vs. strict.
Ingo
I think Caml and Erlang are missing. Caml /= ML. Both are definitely in PRODuction use. And Haskell is not intended solely for ACADemic use. I support Ingo that another axis is laziness support.
jetxee
I would add Scheme: DT, PURE other ACAD
Overflown
@Peter - Haskell's `print()` doesn't print, it returns an IO action which you must sequence through `main` in order to run. Haskell is effectively pure (minus `unsafePerformIO` and `Debug.Trace` loopholes).
ephemient
@epheminet tx for the ifno , @brian and others, tx, very nice answer here
Peter
Hey Jalf, no coincidence you have 15k + rep :-) It's always almost the lesser gods shouting the loudest and trying to close questions I have noticed... ('The computer says no' kind of guys from Little Britain (the series i add quickly not to offend any Britisch) I guess you don't need to bother other people when you have a bit of confidence. "Hey I have some power!! Lets show it to the world!!" Now : I get the point of it, but I myself would never close a question, since it's just
Peter
not a smart thing to do : and everybody who wants to do that again (or make sth CW) answer this : How is it that something subjective can be proposed to be closed because it is subjective, by a system that is even more subjective??This is, without question, intellectual unfair.
Peter
Another language: CAL/OpenQuark ST,PURE JVM PROD(I don't have sufficient Karma to edit the wiki page)
tdavies
Kind of silly that you think Haskell is purely for ACADemic use. That is highly based on opinion, and I don't think it should be in an answer.
Rayne
@Rayne: Are you joking? There is only one company in the world with a serious investment in Haskell, Galois.
Jon Harrop
+5  A: 

Haskell will certainly teach you functional programming, and it is cross platform, has GUIs, is used commercially, and gives you good options for multicore programming. It wouldn't be the wrong choice.

It depends on what exactly you're seeking to learn.

Don Stewart
+3  A: 

I'd agree with those suggesting you take a look at F# It allows you to mix OOP and functional programming style in a (almost - downcasts to interface, I'm talking to you!) seamless fashion, is pretty fast, includes full interoperability with .NET, is statically typed (compile-time type resolution is great and will save you some headaches associated with dynamic languages...besides you get intellisense!) and last but not least it's becoming supported out of the box in VS2010. The beauty of F# is that it doesn't force you down a path, but lets you do efficiently and elegantly what you want, the way you want to do it.

emaster70
+2  A: 

I'll just plug Erlang as a DT/MUT/Other/PROD language since no one else has.