topviz
Re:The Unreasonable Effectiveness of C (2013)
on Friday November 28, 2014 @12:11PM (#8671486)
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.
Re:The Unreasonable Effectiveness of C (2013)
on Friday November 28, 2014 @03:20AM (#8670099)
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