views:

280

answers:

2

Let's say I want to write a server in Haskell. The kind that has high concurrency and simple processing. The kind that would be robust to failures and offer high availability. The kind that Erlang would be good for.

What would be a good set of tools, whether a framework or a set of primitives, to start from?

A: 

Great place to start is the seminal paper by Simon Peyton Jones The Awkward Squad.

... I recently heard a talk you might find relevant. See details at the galois website

Kevin Won
@Kevin, almost, but you got some details wrong. Firstly, the speaker was Johan Tibell from Google/Youtube, and select() itself isn't a big problem (having 1024 simultaneous handles is a bit rare) -- and anyway, you don't need to wait, the event lib, which uses epoll, is already available: http://github.com/tibbe/event You can see details here: http://donsbot.wordpress.com/2010/01/17/playing-with-the-new-haskell-epoll-event-library/
Don Stewart
And I strongly disagree that "there is a lot of stuff lacking in order to really kill it on the perf front server-side" -- performance is excellent, and a few million threads is easily doable today.We build and benchmark concurrent servers all the time at Galois, and performance is rarely an issue -- Erlang's overheads are shocking in comparison (it is aimed at a different use case: distributed systems, not high perf. servers).
Don Stewart
thanks for the correction!
Kevin Won
I think I'll take my foot out of my mouth and just edit the post back to where I started w/ the awkward squad.
Kevin Won
Sorry for jumping on the comment like that, it's been a long day :}
Don Stewart
no. it's all good. you corrected my inaccuracies.
Kevin Won
Like your stack underflow avatar :)
Wei Hu
+8  A: 

This is precisely what Haskell is great at. And it has excellent multicore parallelism support, so when you use more threads, you can take advantage of extra cores easily. Remember though, Haskell's aimed at great performance on multicore, Erlang's a bit different, emphasising distributed systems more, and not so much raw performance (e.g. see the shootout, http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=ghc&lang2=hipe The Haskell's almost always much faster and uses much less memory).

Now, to get started:

You should find this task relatively easy, and fun!

Don Stewart