Sunday, December 07, 2008

Haskell it is

For my own research (not for consulting work, at least for now) I need to speed up machine learning runs and other experiments. I have "4 cores" to work with (and I hope that my next server purchase for my home office has many more than that) so I have been playing around with different programming languages that support concurrency without a lot of effort.

Haskell has impressive run time and memory performance; for example: comparing Haskell and Scala. I have been reading an online version of "Real World Haskell" and recently ordered a print-copy of the book.

I usually do most of my exploratory/research programming in Scheme or Common Lisp so using a different language is fun. Gambit-C Scheme does have the Termite package for concurrency but something more main-stream like Scala or Haskell seemed like a better idea. I invested some learning time in Erlang about a year ago but I think that Erlang is more optimized for concurrency over different computers on the same LAN rather than using many cores in a single server.

5 comments:

Don Stewart said...

Good luck, and lean on the large Haskell community for help. I agree, Haskell's aiming at fast shared memory machines, Erlang's aiming at fault tolerant distributed systems.

Quite different markets.

Mark Watson, author and consultant said...

Thanks Don. I am a real novice at using Haskell but since I enjoy learning and using the language, I hope to get proficient sooner rather than later :-)

Bjørn Arild Mæland said...

I'm just curious, but did you consider Clojure? If so, why did you chose Haskell instead? The reason for my question is that I want to pick up one of those languages myself.

Mark Watson, author and consultant said...

Hello Bjørn,

Clojure looks good and the fact that it runs on the JVM is a big win. However, I was looking for something that would not only serve a requirement for high performance/low memory use but also something that would stretch my brain a bit - I enjoy learning new things.

I am already using Common Lisp a lot right now (examples for a book on AllegroGraph) and I generally use either Common Lisp and Scheme for about 25% all of my development (averaged over the last 10 years) - so I was looking for something different, and not Lisp-like.

Andrew Whaley said...

I made the same choice, I used to use Gambit for everything but have recently switched to Haskell. GHC is so fantastic, I've noticed a 2-3 times speedup when compared with my Scheme code (and Gambit is no slouch) and this is even when using purely functional data structures like Maps compared against Hashtables in Gambit.

Hope it's going well for you.