Interpreter and Compiler

Syeda Ismat Farjana
3 min readJun 4, 2020

In the world of computer science to do any kind of work we need to send the command to the computer. If I assume that a member of human species lands on an alien planet with a broken spaceship.

image source: https://www.pinclipart.com/pindetail/iiTxbm_spaceship-clipart-free-spaceship-clipart-free-download-cartoon/

Now the human needs some help from the alien but no one understands others language. We need a “middle man” helping hand to translate the need of humans to the member of the fellow alien species. If we suppose the alien friend is the computer and the instruction list to fix the spaceship is the command to be passed on, this is where the explanation of “Interpreter” and “compiler” starts. Suppose there are two types of helping robots that can translate the situation in the alien language.

The interpreter will take the list of notes from humans and will translate it step by step to the alien language and then the alien fellow will do that step. This one step at a time method can keep going until the work is done. And if by any chance human gives a wrong note, there is enough time to correct that by giving the right notes to Interpreter and let the alien do it again until the work is finished happily. Though it is a little slower in the end the space ship is all ready to fly up high again without any bigger harm.

On the other hand, the Compiler will take the list of notes, will translate the whole at once, and will say bye-bye. All this might be a little more time consuming but after this everything is going to be very fast. After handing over the translated list to the alien friend, he can fix the spaceship so fast without any interruption. Now if the human gave some wrong instruction by mistake that was translated by the compiler, there is no way to stop the alien friend for correcting the problem because the compiler is not there anymore. So in the end, there is a big chance of doing big harm to that spaceship. The process seems faster but there is a big chance of doing it all wrong while working with the compiler.

This is the exact way the interpreter and the compiler work on the computer.

Interpreter:

The Interpreter is a computer program that starts right away, takes its time to run while translating the command, and gives the chance of fixing any mistakes by giving the chance of monitoring the result. The interpreter is always in between the program and the computer. It translates line by line.

Compiler:

The compiler is the program that takes an extra long time to prepare the translation all at once but after that, the program will run very quickly. Compiler piles together with the entire program and translates the whole thing all at once.

--

--

Syeda Ismat Farjana

I am a physician, eager to learn Coding and eventually jump into the world of AI so I can work for the future.