The “C is Efficient” Language Fallacy
“[…] It’s a variation on the extremely common belief that C and C++ are the best languages to use when you need code to run fast. They’re not. They’re good at things that need to get very close to the hardware – not in the efficiency sense, but in the sense of needing to be able to fairly directly munge the stack, address specific hardware registers, etc. But they are dreadful languages for writing real scientific and/or numerical code. […]”
From: Good Math, Bad Math
In summary: C is for bit twiddling, OCaml kicks its ass for real numerical work, and all the scientists are still using Fortran where performance *really* matters, anyway.
Of course this is as of two years ago, I’d like to see how Haskell and compiled Erlang stack up now, and maybe Stalin (a Scheme -> C compiler). And while we’re at it, let’s be fair to C and try LLVM or Intel’s C compiler instead of GCC. Regardless though, all of his points seem to stand that there’s still loads of optimizations that simply cannot be done for C, which will always leave it behind as far as raw on the metal performance is concerned.
1 Comment »