It can simplify your code to make it perform better before transforming into a lower level language.Ĭompiled code is really hard to read, so making changes on the fly straight on the file is not doable.
It rewrites your code in a lower level making it faster to run due to less operations needed, better performance overall. The C++ compiles it's source into machine language code and it runs through linkers to attach the right libraries needed so you can run that executable using the loaders. In java for example it creates byte codes, which the Java Virtual Machine reads and executes it. The machine is really hard for human read, so you use a high level language to generate the behaviors that you expect a program to execute and let the compiler create low level ones. It's done in this way so the execution of the program related to that gets much faster since it's on machine level.
The language that read your files, compute your code and generate new files (machine level) is a compiler. But leaving this aside what's the difference between interpreted and compiled language? Both words say it for themselves, let's start with compiler. Both types are widely used today, in different scenarios and on different environments and on sectors.