A quick search on the role of compiler brings up the following:
A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses.
However, I also read that every language needs to have a target runtime system and programs written in that language execute in the context of the runtime system.
Adding up the two, it appears that a compiler converts programs into bits understandable by the runtime system and the runtime system acts as the agent interpreting the bits, translating them to the processor intructions. Is this correct? If not, how else are compiler and runtime system related?
And if the above is correct, it would imply the following:
- two executables compiled from programs with identical logic written in different languages would not be identical
- an average machine would have dozens of runtimes which doesnt seem to be the case.
What am I missing here?