Role of Compiler-Interpreter

As we know, a computer is only capable of understanding machine code binary code 0 and 1 since inception, human-readable code must be either interpreted or translated into machine code to command a computer.

The words and statements used to instruct the computer may differ, but no matter what words and statements are used, just about every programming language will include statements that will accomplish the input and output.

An interpreter is a program (often written in a lower level language) that interprets the instructions of a program one instruction at a time into commands that are to be carried out by the interpreter as it happens. Typically each instruction consists of one line of text or provides some other clear means of telling each instruction apart and the program must be reinterpreted again each time the program is run.

A compiler is a program that translates the instruction of a program one instruction at a time into machine code. The translation into machine code may involve splitting one instruction understood by the compiler into multiple machine instructions. The instructions are only translated once and after that the machine can understand and follow the instructions directly whenever it is instructed to do so.

Input :
Input is the act of getting information from a device such as a keyboard or mouse, or sometimes another program.
Output :
Output is the opposite of input; it gives information to the computer monitor or another device or program.

NOTE: C++ is mostly compiled rather than interpreted (there are some C++ interpreters), and then “executed” later. As complicated as this may seem, later you will see how easy it really is.

Related posts