HN user

topviz

17 karma
Posts0
Comments2
View on HN
No posts found.

Can you give an example of the code you write which is on par with C in terms of speed and is non-trivial? Did you look up the algorithm? (it is perfectly defined recursively) Arguing what is nicer is subjective.

To clarify, I did not write the code (mine is the C version), the results are from the paper. Read it, beat it and post results.

Haskell is beautiful and mind-bending, but to get close to C in any non-trivial problem, you will end up writing imperative code. We have 4 implementations of a graph algorithm:

a) Idiomatic Haskell takes ~25 minutes

b) Monadic Haskell takes 11 seconds

c) C++ takes 3 seconds

d) C takes 1 seconds (5x less memory than b))

If you look at all the micro-benchmarks, C uses far less memory than Java or Haskell and the memory is the bottleneck in the most cases.

This is the reason why HPC is FORTRAN, C and C++.

Reference: Computational Topology via Functional Programming: A Baseline Analysis