Sie sind auf Seite 1von 3

Compiler A compiler is a piece of code that translates the high level language into machine language.

When a user writes a code in a high level language such as Java and wants it to execute, a specific compiler which is designed for Java is used before it will be executed. The compiler scans the entire program first and then translates it into machine code which will be executed by the computer processor and the corresponding tasks will be performed.

Shown in the figure is basic outline of the compilation process, here program written in higher level language is known as source program and the converted one is called ob ect program.

Interpreter !nterpreters are not much different than compilers. They also convert the high level language into machine readable binary e"uivalents. #ach time when an interpreter gets a high level language code to be executed, it converts the code into an intermediate code before converting it into the machine code. #ach part of the code is interpreted and then execute separately in a se"uence and an

error is found in a part of the code it will stop the interpretation of the code without translating the next set of the codes. The main differences between compiler and interpreter are listed below: $ The interpreter takes one statement then translates it and executes it and

then takes another statement. While the compiler translates the entire program in one go and then executes it. $ %ompiler generates the error report after the translation of the entire page

while an interpreter will stop the translation after it gets the first error. $ %ompiler takes a larger amount of time in analy&ing and processing the

high level language code comparatively interpreter takes lesser time in the same process. $ 'esides the processing and analy&ing time the overall execution time of a

code is faster for compiler relative to the interpreter.

%haracteristics of good language ( There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important for making a programming language good are: Simplicity : A good programming language must be simple and easy to learn and use. It should provide a programmer with a clear, simple and unified set of concepts, which can be easily grasped. The overall simplicity of a programming language strongly affects the readability of the programs written in that language, and programs, which are easier to read and understand, are also easier to maintain. It is also easy to develop and implement a compiler or an interpreter for a programming language, which is simple. However, the power needed for the language should not be sacrificed for simplicity. Naturalness: A good language should be natural for the application area, for which it has been designed. That is, it should provide appropriate operators, data structures, control structures, and a natural synta! to facilitate the users to code their problem easily and efficiently.

Abstraction: Abstraction means the ability to define and then use complicated structures or operations in ways that allow many of the details to be ignored. The degree of abstraction allowed by a programming language directly effects its writ ability. "b#ect oriented language support high degree of abstraction. Hence, writing programs in ob#ect oriented language is much easier. "b#ect oriented language also support re usability of program segments due to this features. Efficiency : $rograms written in a good programming language are efficiently translated into machine code, are efficiently e!ecuted, and ac%uire as little space in the memory as possible. That is a good programming language is supported with a good language translator which gives due consideration to space and time efficiency. Structured: Structured means that the language should have necessary features to allow its users to write their programs based on the concepts of structured programming. This property of a moreover, it forces a programmer to look at a problem in a logical way, so that fewer errors are created while writing a program for the problem. Compactness : In a good programming language, programmers should be able to e!press intended operations concisely. A verbose language is generally not liked by programmers, because they need to write too much. Locality : A good programming language should be such that while writing a programmer concentrate almost solely on the part of the program around the statement currently being worked with.

Das könnte Ihnen auch gefallen