Previous: Programming Languages
Reference:
Compiler and Interpreter Critical Differences - Spiceworks
When you write a program, regarding what programming language you use, often the high-level ones since humans can write and understand those. The program will go through the process of translation, often translating a high-level program to a low-level program, such that the computer can understand and execute.
<aside> 💡
Computers only understand the low-level languages (machine language, machine codes or binary codes, which are all classified as low-level languages), which are not human-friendly (humans cannot understand them).
Think of them as simply the ‘native’ language of the computer.
</aside>
This is done through a compiler or an interpreter.
A compiler is a piece of software that transforms source code into object code before executing it. Simply put, a high-level language is converted into machine/binary language, and this stage is required to make the program executable. This is because the only language the computer understands is binary.
A compiler translates the entire source code into a machine-code file, and the machine-code file is then executed.
As an intermediate phase, certain compilers transform the high-level programming language into assembly language, and others directly convert it to machine code. This conversion of source code into machine code is called compilation. Popular computer languages that use compilers include C, C++, COBOL, and Fortran, among others.
The operation of a compiler can be categorized as follows: