Compiler Vs Interpreter

This article gives the brief idea of Compiler and Interpreter and the difference between them and some information about how the computer compiles or interprets the source code

Compiler

A compiler is a program that translates program (called source code) written in some high level language into object code. The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instructions. A compiler translates high-level instructions directly into machine language and this process is called compiling.

Interpreter

An interpreter translates high-level instructions into an intermediate form, which it then executes. Interpreter analyzes and executes each line of source code in succession, without looking at the entire program; the advantage of interpreters is that they can execute a program immediately. Compilers require some time before an executable program emerges. However, programs produced by compilers run much faster than the same programs executed by an interpreter.

Compiled programs generally run faster than interpreted programs. The advantage of an interpreter, however, is that it does not need to get through the compilation stage during which machine instructions are generated. This process can be time-consuming if the program is long. The interpreter, on the other hand, can immediately execute high-level programs. For this reason, interpreters are sometimes used during the development of a program, when a programmer wants to add small sections at a time and test them quickly.

Because compilers translate source code into object code, which is unique for each type of computer, many compilers are available for the same language. For example, there is a C compiler for PCs and another for Unix computers.

Compile

Compiling is a process of transforming a program written in a high-level programming language from source code into object code. Programmers write programs in a form called source code. Source code must go through several steps before it becomes an executable program. The first step is to pass the source code through a compiler, which translates the high-level language instructions in the source code follow its syntax rules. If not it will inform the programmer where rules have been violated.

The final step in producing an executable program –after the compiler has produced object code – is to pass the object code through a linker. The linker combines molecules (different program segments) and gives real values to all symbolic addresses (memory locations), thereby producing machine code.

Source code

Program written in a particular programming language in its original form is called source code (program). The word source differentiates code from various other forms that it can have (for example, object code and executable code). To execute the program, however, the programmer must translate it into machine language. The compiler translates the source code into a form called object code. Source code is the only format that s readable by humans. When we purchase programs, we usually receive them in their machine-language format. This means that we can execute them directly, but cannot read or modify them.

Object code

Object code is the code produced by a compiler. Object code is often the same as or similar to a computer’s machine language. The final step in producing an executable program is to transform the object code into machine languages, if it is not already in this form. A program called linker does this job.

Liveware

Liveware refers to all personnel who deals with the computer and its management.

Example:

  • Hardware Maintenance Engineer
  • Software Engineer
  • System Analyst
  • Programmer
  • Data Operator
  • Computer Technicians

Firmware

This is the term given to in-built programs of the computer, which give instructions to the computer. It is placed within computer systems at the time of manufacturing. ROM can be taken as firmware, which is hardware-containing software to control the computer software. Firmware is a hardware and a software in one.

7 Responses

3dillusion
06.07.05

Thanx a load, a nice brief recaputulation… helped me a lot in exms…

Amit
06.07.05

Its a good article. And realy gives about the knowledge of computer compilation

karthick
06.07.05

Its a good article

Samah
06.07.05

Thanx a lot

pawan
06.07.05

shud b mre explanatory

dede
06.07.05

fine

06.07.05

tks

Leave Your Response