Concurrent Functional Languages

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

jgn
Posts: 7
Joined: Fri Jul 01, 2011 1:19 am UTC

Concurrent Functional Languages

Postby jgn » Sun Jul 31, 2011 3:22 pm UTC

Two years into my CS degree I've used Java almost exclusively (Racket, MIPS-32, and Prolog for some smaller classes). I've been using C for my own projects this summer and have worked in C++ before. I know I could use Java to explore concurrency/parallel programming but I see Java as something you use when you have to, not something you use because you like it. (Does anyone actually enjoy Java?)

I thought it would be fun to jump into a functional, concurrent language to get more experience with both. There seem to be a few main choices:
  • Erlang
  • Clojure
  • Scala
  • Haskell?
I like that Haskell is pure functional, but I don't know much about it's support for cuncurrency. I fiddled with Erlang yesterday and found it fairly nice. Clojure is a Lisp, and I like that a lot. I know I'm taking two classes this term that will use Racket and/or Haskell, so Clojure and Haskell are attractive. Scala and Erlang appear more practical and I wonder if putting either of them on a resume would do me more good.

Thoughts and suggestions?

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Concurrent Functional Languages

Postby b.i.o » Sun Jul 31, 2011 4:38 pm UTC

All are worth learning, in my opinion. If you're really trying to do serious concurrency I think Erlang's still the best choice, but all can do things concurrently fairly easily, and I think any is an okay choice for learning about concurrent programming. None is going to mean anything on your resume for most programming jobs, and they'll all likely carry about equal weight when applying to the exceptions to that rule.

If you're looking for something that will teach you the most new things I'd go with Haskell. It's the most different from what you've done already (excepting maybe Erlang), and, unlike Erlang, is used as a general purpose programming language. There's also a much larger community and there'll be a lot more resources for learning it/getting help. And, in my opinion, having experience with something in the ML family of languages is very helpful.

Clojure's a Lisp, which is nice. It also runs on the JVM, which, given your experience, is also nice. Scala is also a fine language and also on the JVM, although it's probably the least functional of them. (Scala's a lot like Java except functional and not awful to program in.)

Basically, it doesn't really matter, though. They'll all teach you a lot, and all can do things concurrently. I'd say you're most likely to get actual use out of one of the JVM languages since they're on the JVM, and least likely to get use out of one of Erlang since it's not really used for anything except really beefy concurrent applications.

User avatar
MHD
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Concurrent Functional Languages

Postby MHD » Mon Aug 01, 2011 2:18 pm UTC

I would personally remove Scala from the list.
Scala is IMHO a weird, twisted excuse for a functional programming language, which tries to be Functional Java, and has a bunch of different terminology and weirdness.

I would recommend Haskell, because there is a good chance that Haskell will become a major language in the future.
Haskell is also one of the most "different" functional languages out there, and it will blow your mind for the better.
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"

jgn
Posts: 7
Joined: Fri Jul 01, 2011 1:19 am UTC

Re: Concurrent Functional Languages

Postby jgn » Mon Aug 01, 2011 11:31 pm UTC

I stopped considering Scala after looking at some code on their website, it just looks too much like Java. As much as I like Lisp, Clojure is out because I want to stay off the JVM. Erlang's concurrency just looks really simple but I think I'll dig into Haskell. It'll probably teach me more about functional programming and I might end up using it this term anyway.

User avatar
WarDaft
Posts: 1583
Joined: Thu Jul 30, 2009 3:16 pm UTC

Re: Concurrent Functional Languages

Postby WarDaft » Tue Aug 02, 2011 7:03 pm UTC

Haskell has more approaches to concurrency (although technically speaking, in non-IO Haskell concurrency doesn't mean a lot, because there's no assured order of execution by default) and parallelism than you can shake a stick at. I do not have enough experience with the others to actually recommend it over them however.
All Shadow priest spells that deal Fire damage now appear green.
Big freaky cereal boxes of death.

User avatar
Aaeriele
Posts: 2127
Joined: Tue Feb 23, 2010 3:30 am UTC
Location: San Francisco, CA

Re: Concurrent Functional Languages

Postby Aaeriele » Wed Aug 03, 2011 12:11 am UTC

Besides, Haskell has http://learnyouahaskell.com/chapters which is just awesome.
Vaniver wrote:Harvard is a hedge fund that runs the most prestigious dating agency in the world, and incidentally employs famous scientists to do research.

afuzzyduck wrote:ITS MEANT TO BE FLUTTERSHY BUT I JUST SEE AAERIELE! CURSE YOU FORA!

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Concurrent Functional Languages

Postby Berengal » Thu Aug 04, 2011 9:24 am UTC

I put my vote in with Haskell. Not because it neccessarily has better concurrency than any of the other languages (erlang has a very nice model built-in), but because it provides a very good foundation to learn about all the different models (including Erlang's) without really giving any of them any special treatment. Everything is provided as a library (with possibly extra magic runtime code), nothing is implemented specially by the compiler. Also, being purely functional the difference between doing more than one thing at once (concurrency) and solving different subtasks of a larger task at the same time (parallelism) is readily apparent.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests