People always say that C is more efficient than any other high level language.I don’t understand why. I know assembly is efficient because it has a close relation to machine language .
But C and C++ or ruby,lets say,they are all going to be ‘translated’ into machine language,right? By more efficient,does it mean the machine code is better,or it takes less time to be ‘translated’ into machine code? What if there is some compiler or interpreter that can produce faster,also result in better machine code?
No, it does not. it has a 1.1 relation – it is a written representation of exact machine code commands. It is a mnemonic language – basically replacing byte codes with another representation. All higher langauges miss that.
Yes, but the question is when and how efficient. low level languages – and C is one – allow less advanced constructs and are thus closer to assembler and easier for the compiler to optimize.
Outside of just in time compiled languages or interpreters NOONE cares about how much time it takes to translate. C is statically translated, once, then executed.
Then the statement is not true. Funny enough, that is not really the case – it is not that easy to make a super efficient compiler for higher languages. Basically you keep asking why a super sports car is so fast & state it would not be considered to so fast anymore when every Fiat Panda would have more horsepower – but sadly they don’t have and never will have.