Re:Are functional languages inherently slow?
by postfuturist on Friday July 27, 2012 @01:06PM
(#4302393)
pull request? I'm no Haskell expert (which apparently you need to be to get decent performance.)
My point is, I am not Haskell expert, but I know that linked lists aren't an efficient data structure for what we're doing. You didn't use lists in your other implementations, so it was just weird that you did for Haskell (originally, and then sort of again for life-array.hs).
For your life-array.hs implementation, you replaced the Grid with an array, but not the "surroundings" with one, even though you used Vector for both in your SML implementation.
Built with -O2 option: https://gist.github.com/3189306
Sorry if I came off a bit assholish. People have been saying that you need to be a Haskell expert to get good performance forever, and in my experience this just isn't true. I will admit that there is clearly a problem with how things are introduced, as it is common that new Haskellers think they can use lists for every thing. I am sure part of the problem is that this is one of the few data structures available from the Prelude.
Re:Are functional languages inherently slow?
by postfuturist on Friday July 27, 2012 @06:34PM
(#4303886)
No sweat, thanks for the gist, I'll add it the repo. I'm impressed, actually, if it brings the runtime under a second, because only a couple languages managed that.
The act of finding the correct strictness hints seems a bit like black magic.
The code is so incredibly close to your SML code (where you also spell out that you are using the Vector type). I am just blown away by how matter of fact you were in your statement.
Please either change your benchmark to use the same data type as all of the other examples, or stop using it as an example of Haskell's performance.