Compiler
C is a middle or low level language programming language. So we need to convert this into binary language . To convert high level language into low level or binary language we need Translators.
- Compiler is a translator ,which translate a program written in high-level language into binary language (machine language)
- Compiler translate the entire source program into object program at once.
- In compiler , intermediate object code is generated , condition control statements are execute faster .
Example of compiler:- GCC, c compiler.
Interpreter
Interpreter translate a program written in high -level language into machine language. And it is also involved in its execution.
- Interpreter translate entire source of program into object program line by line and immediately executes.
- It takes single instruction as input, there is no intermediate object code is generated.
- In interpreter memory requirements is Less.
- Every time interpreter convert higher level program into lower level program.
Example:- BASIC
Role of Compiler
- Compliers reads the source code, outputs executable code
- Translates software written during a higher-level language into instructions that computer can understand. It converts the text that a programmer writes into a format the CPU can understand.
- The process of compilation is relatively complicated. It spends a lot of time analyzing and processing the program.
- The executable result's some sort of machine-specific code .
Role of Interpreter
- The interpreter converts the source code line-by-line during RUN Time.
- Interpret completely translates a program written during a application-oriented language into machine level language.
- Interpreter allows evaluation and modification of the program while it's executing.
- Relatively less time spent for analyzing and processing the program.
- Program execution is relatively slow compared to compiler.
0 Comments