What is an Interpreter?


An interpreter is a special computer program that is used to execute computer program instructions written in high-level programming languages. The interpreter transforms the high-level program into an intermediate language then executes it line by line.

It only translates one statement of the program at a time into machine code and takes a very less time to analyze the source code. In human language interpreter is basically a translator.

Humans can only able to understand high-level languages, which is called source code. On the other hand, computers can only understand programs written in binary language in the form of 0 and 1, so either an interpreter or compiler is required to translate source code into binary code form.

Also Read: What is google Adsense?

Difference between compiler and Interpreter:

Below is the flow chart to express working of a compiler and interpreter.

flow chart of interpreter and compiler

Programming languages are understand by computer in two ways: interpretation and compilation. As the name suggests, an interpreter transforms or interprets a high-level programming code into such code that can be understood by the machine or into an intermediate language that can be easily executed. While Compiler scans the entire program and translates the whole of the code into machine code at once. A compiler takes a very large time to analyze the source code.

The interpreter scans each statement of code and then execute it. Whereas, an assembler or a compiler converts a high-level source code into compiled code that can be executed directly by the operating system by creating a .exe program.

Both compilers and interpreters have their own pros and cons (advantages and disadvantages). A compiler is preferable since its output runs much faster than line to line output. Python, Ruby, and JavaScript are examples of interpreted languages while Java, C++ and C are examples of compiled languages.

Read more posts like this: Csquery

Leave a Reply