> I question the results when something beats C for speed. Either it is poor C 
> code, or there is something weird going on.

Or, the compiler is able to take advantage of information in language X source 
not available from the C source to generate better code than available C 
compilers? That's not hard to grasp, pre-**restrict** C was widely known to be 
slower than Fortran. Also, as @flother points out, the C generated by a good X 
to C compiler may be better than code anyone is likely to write by hand. The 
whole program optimizing Scheme to C compiler compiler 
[Stalin](http://community.schemewiki.org/?Stalin) was 
[known](https://justindomke.wordpress.com/2009/02/23/the-stalin-compiler/) to 
generate C code much faster than hand written equivalents. Unfortunately, it 
was also known to be very slow; but it's purpose was to generate a fast 
executable.

When Nim's llvm backend is stable it would be fun to have a running benchmark 
against C, C++, Rust, Swift, and the ldc D compiler. I think the results would 
be revealing. 

Reply via email to