Machine independence a program written in a high

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: be reinterpreted every time the loop is executed. As compared to compilers, interpreters are easier to write because they are less complex programs than compilers. They also require less memory space for execution than compilers. The main advantage of interpreters over compilers is that a syntax error in a program statement is detected and brought to the attention of the programmer as soon as the program statement is interpreted. This allows the programmer to make corrections during interactive program development. Therefore, interpreters make it easier and faster to correct programs. The main disadvantage of interpreters over compilers is that they are slower than compilers when running a finished program. This is because each statement is translated every time it is executed from the source program. In case of a compiler, each statement is translated only once and saved in the object program. The saved object program can be executed many times as and when needed, and no translation of any statement is required during the execution of the program. Because the interpreter does not produce an object program, it must perform the translation process each time a program is executed. To combine the advantages of both interpreters and compilers, sometimes the prograrn development environment of a computer system provides both a compiler and an interpreter for a high-level language. In these cases, the interpreter is used to develop and debug programs. Then, after a bug-free state is reached, the programs are compiled to increase their execution speed. The object program produced by the compiler is subsequently used for routine processing. Assemblers, compilers, and interpreters are also referred to as language processors since they are used for processing a particular language instructions. Advantages and Limitations of High-level Languages Advantages of High-level Languages High-level languages enioy the following advantages over assembly and machine languages: 1. Machine independence. A program written in a high-level language can be executed on many different types of computers with very little o...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online