views:

1398

answers:

15

I'm a very experienced Object Oriented developer. Which of the Functional Programming languages would be the best one for getting my feet wet? Keeping in mind:

  • IDE
  • Compiler Maturity
  • Debugging Tools

Which Functional Programming language would you recommend?

+13  A: 

Scala?

Good IDE support, Java class library and debugging tools. And it's OO/functional, not just functional. And it runs in the JVM.

http://www.scala-lang.org/

alamar
Scala's IDE support is actually pretty horrible. I've tried the Eclipse and NetBeans plugins, and they were both really broken. It was like whoever wrote them got them to compile then shipped them without using them at all. Seriously, I couldn't even create a project in NetBeans without getting a weird error message. It's a great language, but I would recommend Emacs for anyone writing code in it.
Jay Conrod
+27  A: 

I would take a very long look at F# for this. It's got Visual Studio as the IDE which is fantastic and a pile of resources.

A few of our guys have started using it and exploring the power of the language.

Mat Nadrofsky
F# is coming out officially with VS 2010, but it's been shipping regularly for awhile and I've used it for a pretty big project.
Drew Hoskins
However, the debugging support wasn't so great when I used it over a year ago. I expect it will have drastically improved by now.
Drew Hoskins
Yup. Good point. Being the it's an MS product in in the Visual Studio family (directly soon) it's a great bet that it's going to get attention in the same way C# has.
Mat Nadrofsky
Why? There's a descent chance that C# would continue to get all the attention.
alamar
I'm not saying it would detract at all from C# or even be comparable. I'm speaking to the active development of the language. If MS is putting the product into the Visual Studio Family for 2010, there's a good bet they're going to be investing in it's growth.
Mat Nadrofsky
@Mat - J# :P
dss539
I'd be very wary about using a proprietary language, you never know when they might pull the plug...
Robert
+4  A: 

I would consider F# - you get the best of both worlds.

http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/

Charles
+9  A: 

Javascript is very good for learning and using functional programming.

You implicitly use it when setting an onclick for an html element.

It's close enough to the C style syntax to not have a lot of extra confsion because of syntax.

It can be used in the browser and on the command line through Java.

For a good overview, watch the Crockford videos from YUI theater.

Tom Hubbard
Or that, really.
alamar
e-satis
Javascript isn't that functional! It can be but most JS-Code is written imperatively.
Dario
igouy
I agree that most JS code is written imperatively. However, I believe that JS offers a very easy introduction to functional programming.As for browser only, JDK 1.6 actually contains Rhino which allows javascript to be used from the command line. It also allows the easy integration of Java objects into JavaScript.
Tom Hubbard
Writing functions is part of being an OO programmer. As far as I can tell, that's completely different from functional programming. For example, how would you define a monad in Javascript?
Kieveli
kieveli: monads don't need special syntax. the concept can be used in any programming language.I don't see JavaScript as being any more functional than it is prototypical OOP. Aside from first class functions, there is nothing inherently "functional" about it. It encourages an imperative style by not forcing implementations to optimize tail-calls. And, though not really against a "functional" style, it's scoping rules are odd to say the least. Because of this, lexical closures in the language must be taken with a grain of salt.
Andrew Gwozdziewycz
@Kieveli Considering that JavaScript is based largely on Scheme and Self (http://en.wikipedia.org/wiki/Javascript), I'd say it's about as easy as it is in most other functional languages.
rtperson
+1  A: 

If you're familiar with Visual Studio and .NET, then F# would be a great bet: http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/about.aspx. Of your three criteria, it's got the IDE and debugging tools, but not compiler maturity. I'd look to Lisp (Common Lisp or Scheme) for that.

Kyle Ryan
+7  A: 

Haskell is widely used as is Erlang. F# is up and coming, but much newer. And, of course, there are Lisp and Scheme.

JP Alioto
+19  A: 

Seems to me that if you're an experienced OO programmer, you should learn a functional programming language that does not let you keep on programming in the OO style.

My recommendation is Haskell (although some OO is possible in it too, it's not the typical idiom.) Haskell has mature compilers (ghc) and good testing tools (Quickcheck, etc).

ShreevatsaR
Plus Haskell's method of doing static typing is really, really cool.
Clint Miller
+10  A: 

Scheme, start by reading SICP. After that you can use any language you want.

iny
+5  A: 

Even if i'm going to be down-voted, i've to say O'caml...

IDE: emacs Compiler: pretty good Debugging tools: not so much

but it has a kind of object-oriented flavor that would be good for the transition ....

(otherwise go for F#)

I forgot, there's Nemerle also..a mix of C# with functional programming (I don't what is the status of this project though..)

LB
Upvoted, F# is pretty much based on OCaml yet this language gets ignored by most... I learned it at school and thought it was a good language, but I don't know how it would fare for a business app.
Meta-Knight
+3  A: 

I'd recommend F# (When you're under windows). It has a good IDE (Visual Studio) and debugger, can use the complete .NET-Framework and isn't purely functional like Haskell, but will help getting into functional programming by encompassing object-oriented and some imperative structures. And since it's still being developed and promoted by Microsoft, it won't be soo isolated as Haskell. I think, it has got the biggest "real-world-applicability" of all functional programming languages.

Dario
+5  A: 

The Visual Studio support for F# is a very significant factor. Because F# is strongly typed intellisense picks up errors immediately, and the tool tips showing function types (eg. "int -> bool") are invaluable. Getting to grips with the functional type system is probably the biggest barrier you will face, so, if you've got Visual Studio, then this should be a major plus for F#. (Intellisense just for learning the syntax is also very helpful)

On the other hand, whenever I look for on-line resources on a functional topic (eg. pattern matching, curry functions), I am impressed by the depth of the OCaml community. When I got started with this a year ago, the on-line tutorials and manuals for OCaml were vastly superior to F# (and probably still are).

I actually got to grips with F# by working OCaml tutorials in Visual Studio :)

[Edit, May 2010] With the changes to F# in the last year, I would no longer recommend OCaml for learning F#. The differences are just too significant, and would require you to "unlearn" a lot of OCaml. Best to go straight for one of the F# resources.

Javaman59
+5  A: 

I've worked with both Scheme and some SML-NJ (Standard ML / New Jersey) in the past.

But I would highly recommend picking up The Little Schemer or The Little MLer by Friedman and Felleisen. They start really basic and work up to lambdas and such, in a picture book kind of way.

Given the popularity of OCaml and F# (both in the ML family), The Little MLer might be more what you want.

If you go with Scheme though (and I love Scheme), the SICP is also a great book. I still have mine from college. Friedman, Felleisen, et. al. also have two other Scheme books in their series.

crashmstr
I love dr scheme by felleisen...http://www.plt-scheme.org/
LB
Cool, I'd heard of it, but did not know that Felleisen was involved.
crashmstr
+1 for Little Schemer
dss539
I've got both the updated Little Schemer as well as my original copy of the "Trade Edition" of The Little Lisper that I've had for probably about 15 years.
crashmstr
+1  A: 

I suggest giving Lisp/scheme a try. Just because it's so different from anything else. Practical Common Lisp is a wonderful introduction.

Sander Marechal
+1  A: 

I'd check into LISP. It allows you to flexibly combine what you know of OO with what you want to learn of Functional Programming styles. As Sander said, Practical Common Lisp is a great start, and the Lisp Hyperspec documents well all of the myriad of Common Lisp functions.

Fox
+1  A: 

What about OCaml ??

checklist - IDE: emacs, OcaIDE, cameleon. Compiler maturity: yes. Debugger: ocamldebug with the ability to go back in time (on linux)
ygrek