News for hackers. Stuff that matters.
Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by mr_luc on Thursday August 20, 2009 @05:14PM (#776290)
I have a question about the CPU column:

> 0% 0% 0% 100%

This was a Quad Core CPU, so my first impulse is to ask, does that mean it was running on only one core?

Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by dfranke on Thursday August 20, 2009 @05:24PM (#776324)
Yes. It was compiled with the threaded runtime, but the nature of the problem is such that all but one thread should be blocked at any given time, so the Haskell runtime scheduled them all on the same core.
Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by mr_luc on Thursday August 20, 2009 @05:32PM (#776344)
That's pretty cool! Thanks for the informative response.

Yeah, when I looked at the definition of the problem, it sort of made sense.

Le sigh ... dammit, I should give Haskell more of my attention.

I just hate camel casing and type errors :( And if I'm going to procrastinate about writing For Reals code in a language, various lisps have that covered already.

Although, I'm writing a For Reals app in Ruby (w/merb) at the moment, and it's turning into a bit of an uggo. Maybe I'll procrastinate about finishing it, and give Haskell another go.

Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by dfranke on Thursday August 20, 2009 @05:42PM (#776384)
I hated static typing too until I learned Haskell. I dabbled in OCaml first and hated even that. Haskell and OCaml use the same basic paradigm for their type systems (Hindey-Milner), but Haskell's variant is more expressive. Typeclasses really made all the difference for me.

Also, Haskell is just a really, really difficult language, and it's hard to pass accurate judgment until you've mastered it. When I first started studying Lisp, it took about six weeks of intense study before I really felt like I grokked the language. Coming into Haskell with my existing Lisp background, it took me a year to feel the same way.

Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by mr_luc on Thursday August 20, 2009 @06:30PM (#776500)
That last paragraph is probably what I most needed to read.

I did give The Haskell School of Expression a good whirl -- heh, I brought it down to south america with me, and hacked through a little of it each morning for a couple of months, swinging in a hammock and listening to waves crash and deciding that the water was probably still too cold to go out.

But although I understood what I was reading and understood what the code I had written did ... grok I did not.

I couldn't think creatively in Haskell AT. ALL.

Nonetheless, your comment heartens me. Please reassure me further: are you a person who has ever written or attempted to write a non-trivial mathematic proof?

Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by dfranke on Thursday August 20, 2009 @06:31PM (#776504)
Yes. I was a math major.
Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by mr_luc on Thursday August 20, 2009 @06:47PM (#776546)
See, there's yer problem.

Err, I mean, my problem. Le double sigh.

Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by gaius on Thursday August 20, 2009 @05:26PM (#776330)
You'll notice they all add up to 100%... In this (artificial) test, only one thread is doing work at any time no matter on which core that thread is scheduled. I don't know if it was deliberate (i.e. a clever optimization) but if you're going to use your threads like that it makes sense, avoids cache misses.
Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by ryanpetrich on Thursday August 20, 2009 @05:43PM (#776387)
I wonder what sort of optimization Scala is employing ;)
Re:Haskell is 4.2x as good as Erlang at lightweight concurre... by wglb on Thursday August 20, 2009 @06:40PM (#776531)
You can tell by looking at the colums to the right--they show the load on each of the cores.

What is particularly interesting is that Haskell uses only one CPU to beat Java which is using four.