Page 17 - TP_iPlus_V2.1_Class6
P. 17
• A high-level language is easier to maintain.
• A high-level language is problem-oriented rather than machine-based.
• Programs written in a high-level language can be translated into machine language and
therefore it can run on any computer with an appropriate translator.
• Programs developed in high-level languages can run on any computer, i.e., they are machine-
independent.
Disadvantages of High-Level Languages
• A high-level language has to be translated into machine language by a translator, which
wastes a lot of the computer's time.
• The object code generated by a translator might be inefficient as compared to an equivalent
assembly language program.
i + LANGUAGE TRANSLATOR
A language translator is software that converts a high-level language program into a machine
language that computer understands. There are mainly three types of language translators:
Assembler
An assembler is a program used to translate assembly language (LLL) into machine language so
that the computer can understand it.
Compiler
A compiler is a program that converts the entire source code written in HLL into machine language
(object code) before executing it. It converts the entire program into machine language at once.
It displays the errors for the whole program together. The debugging stage cannot start until the
program is fully compiled. Errors are only viewable after compilation.
Some programming languages that uses compilers are C, C++, COBOL, FORTRAN and JAVA.
Interpreter
An interpreter reads one line of instruction at a time and translates it into machine language. Any
error in the instruction is reported immediately and the programmer can correct it accordingly.
It is slower than the compiler. It reads a code statement, converts it to one or more machine
language instructions, and then executes them. It displays the errors for one line at a time, and
it goes to the next line only after the error is corrected.
Unlike compilers, interpreters do not need to compile the code prior to executing the instructions.
The translation and execution process are done simultaneously.
Some programming languages that uses Interpreters are Python, Java Script, Perl and Ruby.
3 × 2 = 6 Machine Code (00110)
High-level Input Language Output Machine
Language or Translator Language
Assembly Language
15
Categories of Computers and Computer Languages

