Pages

Saturday, March 2, 2013

Programming Language Translation

We have seen in the previous sections that a computer can execute programs written only in a machine code. Therefore a programme written in any other language has to be translated into machine code by using appropriate language translation software to execute it on the computer. The process of converting a program from one language to another is termed Language Translation. There are three techniques for
language translation:
(1) Assemblers
(2) Compilers
(3) Interpreters

1 Assemblers
Assemblers translate assembly language into machine language which can be
recognized by the computer.

2. Compilers
Compilers translate all the commands in a program to an object code which can be understand by the computer. Once a program is compiled, it can be executed by the machine. C and FORTRAN are two
examples of compiler based programming languages.
   When compiling programs, the original program used for the compilation is called the Source Code Program and the resulting program produced by the compiler is called the Object Code Program. The main process what the compiler does is to translate Source Code Program into Object Code Program. During the compilation process, the compiler also checks whether the source program is free of errors with respect to the grammar of the programming language. If the compiler detects errors, error messages are produced and the compilation process terminates without producing the object code. Then the user must compile the program again after correcting the detected errors. The user may have to follow this procedure repeatedly until the program is free of errors. Errors found in a program are called ‘Bugs’ and the process of
eliminating bugs from a program is called Debugging.

3. Interpreters
Unlike compilers, interpreters do not translate the entire program into machine code at once. Instead, an interpreter does the translation at the moment the program is run, one line at a time. As a result, the lines of the program have to be translated into machine code each time the program is run. Therefore, the time taken
to run a program of this type is typically greater than the time taken to run a similar program that has been compiled. ‘VB’ and ‘Python’ are examples of such languages.

1 comment:

  1. nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! תרגום חוזה לעברית

    ReplyDelete