On Friday, 25 October 2013 at 07:50:36 UTC, ilya-stromberg wrote:
I think it's answer for your question. For example, Clang (LLVM
C) is fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM
Haskell) ~ 2 times slower.
The explanation is quite simple. LLVM understand C and C++
runtime. It doesn't understand D runtime (LDC is doing some work
in that regard, but it is still limited). So you see a difference
between C and C++ as some optimization will be done in C/C++ (for
instance heap to stack promotion) when it won't be done in D.
Haskell has really different semantic than C and C++, and quite
far away from the hardware, so you have to expect a performance
drop. The comparison of either C or C++ with haskell is not
really meaningful as it is really comparing apple and bananas.