PERSONAL INTRODUCTION: Hi everyone. This is my first question here and I'm a self-taught programmer just at the beginning. So my question will be very stupid for the most of you. I hope that there are also other rookies that may find this question usefull.
PREMISE: I'm studying programming and computer architecture right now and a concept is bothering me. The books I'm reading often stresses the difference in speed between a programm written directly in machine language and one written in a high-level language. The first one when launched, being read by the processor directly in his own language, is faster.
THE ACTUAL QUESTION: When I compile a programm written in a high-level language, the text I have written is translated into machine language, right? So the executable file that is created contains only machine language, right? So when I launch the program isn't the processor reading anyway his own language?
A sends a letter to B in B's language. A writes a letter in A's language then gives it to C to translate and send it to B in B's language. Isn't B recieving the same text? (same language and roughly same number of words)
There's a multitude of programming languages. Some are interpreted at runtime (scripting languagues), some are compiled "just in time (JIT)" (scripting languages, languages for runtime frameworks like java and dotnet) and some are compiled "ahead of time".
if you are using a language that is compiled to machine code, you are pretty much right with your observation, there still might be some overhead though.
if A gives the letter to C, C translates it like C would, which may not be exactly the same way A would formulate it if he would know the language natively.