0% found this document useful (0 votes)
25 views4 pages

1596078010TRANSLATORS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

1596078010TRANSLATORS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Question

The unfortunate thing about low level and high level programming
languages is that the computer could not understand them. Hence
there is need for a translator.
1. What do you understand by translators
2. Make comparative analysis of the following translators:
a. .Assembler
b. Compiler
c. .Interpreter
3. .Why is there need for high level programming languages.

A translator is a programming language processor that converts


a computer program from one language to another. It takes a
program written in source code and converts it into machine code. It
discovers and identifies the error during translation.
Purpose of Translator
It translates high-level language program into a machine language
program that the central processing unit (CPU) can understand. It
also detects errors in the program.
Different Types of Translators
There are 3 different types of translators as follows:

Compiler

A compiler is a translator used to convert high-level programming


language to low-level programming language. It converts the whole
program in one session and reports errors detected after the
conversion. Compiler takes time to do its work as it translates high-
level code to lower-level code all at once and then saves it to memory.
A compiler is processor-dependent and platform-dependent. But it
has been addressed by a special compiler, a cross-compiler and a
source-to-source compiler. Before choosing a compiler, user has to
identify first the Instruction Set Architecture (ISA), the operating
system (OS) and the programming language that will be used to
ensure that it will be compatible.

Interpreter

Just like a compiler, is a translator used to convert high-level


programming language to low-level programming language. It
converts the program one at a time and reports errors detected at
once, while doing the conversion. With this, it is easier to detect
errors than in a compiler. An interpreter is faster than a compiler as it
immediately executes the code upon reading the code.
It is often used as a debugging tool for software development as it can
execute a single line of code at a time. An interpreter is also more
portable than a compiler as it is not processor-dependent, you can
work between hardware architectures.

Assembler

An assembler is is a translator used to translate assembly language to


machine language. It is like a compiler for the assembly language but
interactive like an interpreter. Assembly language is difficult to
understand as it is a low-level programming language. An assembler
translates a low-level language, an assembly language to an even
lower-level language, which is the machine code. The machine code
can be directly understood by the CPU.

Examples of Translators
Translator Examples

Microsoft Visual Studio


Compiler GNU Compiler Collection (GCC)
Common Business Oriented Language (COBOL)

OCaml
Interpreter List Processing (LISP)
Python
Fortran Assembly Program (FAP)
Assembler Macro Assembly Program (MAP)
Symbolic Optimal Assembly Program (SOAP)

Here are some examples of translators per type:

Advantages and Disadvantages of


Translators
Here are some advantages of the Compiler:

 The whole program is validated so there are no system errors.


 The executable file is enhanced by the compiler, so it runs
faster.
 User do not have to run the program on the same machine it
was created.
Here are some disadvantages of the Compiler:

 It is slow to execute as you have to finish the whole program.


 It is not easy to debug as errors are shown at the end of the
execution.
 Hardware specific, it works on specific machine language and
architecture.
Here are some advantages of the Interpreter:

 You discover errors before you complete the program, so you


learn from your mistakes.
 Program can be run before it is completed so you get partial
results immediately.
 You can work on small parts of the program and link them later
into a whole program.
Here are some disadvantages of the Interpreter:

 There’s a possibility of syntax errors on unverified scripts.


 Program is not enhanced and may encounter data errors.
 It may be slow because of the interpretation in every execution.
Here are some advantages of the Assembler:
 The symbolic programming is easier to understand thus time-
saving for the programmer.
 It is easier to fix errors and alter program instructions.
 Efficiency in execution just like machine level language.
Here are some disadvantages of the Assembler:

 It is machine dependent, cannot be used in other architecture.


 A small change in design can invalidate the whole program.
 It is difficult to maintain.

The main advantage of high-level languages over low-level languages is


that they are easier to read, write, and maintain.
Ultimately, programs written in a high-level language must be translated
into machine language by a compiler or interpreter.

You might also like