Difference between compiler and interpreter

compilerIn computer, both compilers and interpreters are used for the same purpose. They convert one level of language to another level. A compiler converts the high level instructions into machine language while an interpreter converts the high level instruction into some intermediate form and after that, the instruction is executed.Difference between compiler and interpreter is given below:

Compiler

A compiler is defined as a computer program that is used to convert high level instructions or language into a form that can be understood by the computer. Since computer can understand only in binary numbers so a compiler is used to fill the gap otherwise it would have been difficult for a human to find info in the 0 and 1 form.

Earlier the compilers were simple programs which were used to convert symbols into bits. The programs consistes of avery simple and they contained a series of steps translated by hand into the data. However, this was a very time consuming process.

More sophisticated compliers are created using the simpler ones. With every new version, more rules added to it and a more natural language environment is created for the human programmer. The complier programs are evolving in this way which improves their ease of use.

There are specific compliers for certain specific languages or tasks. Compliers can be multiple or multistage pass. The first pass can convert the high level language into a language that is closer to computer language. Then the further passes can convert it into final stage for the purpose of execution.

Interpreter

The programs created in high level languages can be executed by using two different ways. The first one is the use of compiler and the other method is to use an interpreter. High level instruction or language is converted into intermediate from by an interpreter. The advantage of using an interpreter is that the high level instruction does not goes through compilation stage which can be a time consuming method. So, by using an interpreter, the high level program is executed directly. That is the reason why some programmers use interpreters while making small sections as this saves time.

Almost all high level programming languages have compilers and interpreters. But some languages like LISP and BASIC are designed in such a way that the programs made using them are executed by an interpreter.

Compiler
1)A complier converts the high level instruction into machine language.
2)Before execution, entire program is executed by the compiler.
3)List of errors is created by the compiler after the compilation process.
4)An independent executable file is created by the compiler.

Interpreter

1)An interpreter converts the high level instruction into an intermediate form.
2)After translating the first line, an interpreter then executes it and so on.
3)An interpreter stops translating after the first error.
4)Interpreter is required by an interpreted program each time.

Himanshu is a young engineer living in India. Currently working at Cognizant as a Senior Engineer. He is an ethical hacker & blogger too, doing lots of crazy stuff... If you seem interesting, go through his portfolio: www.himstar.info : "Open Source. Millions of open minds can't be wrong!

3 comments: On Difference between compiler and interpreter

Leave a reply:

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer

Sliding Sidebar

We are India’s largest Startup Community


We are team of ' Delhi Startups ' , most active startup community with strict spam policy.
We are making !deas happen..for future, business and jobs without charging anything, with connecting entrepreneurs.. It's a reason to trust on us.
Come and join or subscribe, we will defiantly give a reason to like us.

Our Facebook Page