Skip to main content

Explain Difference Between Compiler and Interpreter

Difference between Compiler and Interpreter

The Compiler and Interpreter are the two main types of Language Translator or Language Processor
Explain differences between compiler and interpreter in detail
Explain some important differences between Compiler and Interpreter


or Differentiate between Interpreter and Compiler


Compiler                                    Interpreter                             
1.    Compiler   converts   a   source program   into machine code as a whole.                                 1.  Interpreter    converts    a    source program    into machine code one statement at a time.           
2. Compiler after translating whole source program, creates object code file, that can be executed.   2. Interpreter does not create object code file. It only creates executable code for only one statement currently interpreted, which is executed. Next time second statement is translated and executed and so on. No object file is created.
3. Program execution is fast. Since once program is compiled successfully, an object code file is produced. Now this object code file is executed. No need of re-compilation unless we change the source code.

                      
3. Program execution is slow. Because every time we want to run a program it is interpreted again.                         
4. Error detection and error removal is comparatively difficult. Because, compiler will show a list of all errors in the whole program. Therefore, sorting out every error individually and removing the cause of error becomes more difficult and time consuming.
                   
4. Error detection and removing error is easy in case of interpreter, because interpreter will show when error at a time and its location in program. So that the programmer can easily catch and remove error.                           
5. More programming languages use compilers for translating source code to object code. 5. The number of high level programming languages that use Interpreter as an option to translate source code into object code is relatively smaller.
6. In compiled high level programming languages program execution does not require Translator or compiler for every execution. Because after first time of compilation, object code file is available that is used subsequently for onward program executions unless we change the source code. In case of change of source code, we need to re-compile the source code to show changes in the object code also. 6. In interpreted high level programming languages, translator program is needed every time for execution of the source program.


You would also like to read:

Types of Language Processors / Language Translators / Compiler, Interpreter, assembler


Comments

Popular posts from this blog

Basic Structure of HTML Document

Basic Structure of HTML Document  The basic structure of an HTML document is given below: <HTML>         <HEAD>                  </HEAD>                 <BODY>                </BODY> </HTML> The above format shows that an HTML document starts with <HTML> tag and ends with </HTML> tag. It is also clear that an HTML document consists of two main sections:  Head Section Head section is used to specify a title of the web page, normally. There are some other uses of Head section too, like linking external style sheets and Java script code, etc. Head section starts with the <HEAD> tag and ends with the </HEAD> tag. <TITLE> tag is used to display a title of...

What are Different Types of Input Devices With Examples

Topic: Different types of input devices of a computer system with examples, pictures and explanation:  Topics Covered are: Definition of Input Devices Functions of Input Devices ( How input devices work? ) Examples of Input Devices Pictures / Images of different input devices Different Examples of Input Devices With Description Keybboard Mouse Trach Ball Trackpad Joy Stick Light Pen Microphone Scanner Graphic Tablet ( Digitizer ) Digital Camera Touch Screen ( I/O Device / Dual Device - Perform Both Functions input + Output ) INPUT DEVICES ( Definition ) Input devices are used to enter data and instructions into computer memory from external world. Input Device is a hardware part of the computer that is used to enter data and instructions into computer memory. The examples of input devices include: Keyboard, Mouse , Track ball, Track Pad, Joy stick, Touch Screen, Light pen,   Scanner , Digital Camera, Microphone, Graphics tablet e...

Microsoft Security Essentials Free Antivirus

Microsoft Security Essentials provides real-time protection for your home PC that guards against viruses, spyware, and other malicious software. Microsoft Security Essentials is a free download from Microsoft that is simple to install, easy to use, and always kept up to date so you can be assured your PC is protected by the latest technology.  Microsoft Security Essentials came into existence as Microsoft's first attempt of a standalone security application for home use. Although it has a simple user interface suitable for beginners, it probably isn't the best choice for more advanced users or professional network administrators, but for the average user, it covers all the bases. Bear in mind, however, that Microsoft Security Essentials doesn't disinfect files - it only deletes them in case of infection. It can be dangerous, if the files are important and contain precious data like financial transaction records or business sale purchase data. System Requirements: ...