Program translates a high-level language program into a separate machine language program

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


Why should I post the question or an answer?

To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.


The pleasure of all reading is doubled when one lives with another who shares the same. -Katherine Mansfield

Computers only understand machine code (binary), this is an issue because programmers prefer to use a variety of high and low-level programming languages instead.

To get around the issue, the high-level and low-level program code (source code) needs to pass through a translator.

A translator will convert the source code into machine code (object code).

There are several types of translator programs, each able to perform different tasks.

Compiler

Program translates a high-level language program into a separate machine language program

Compilers are used to translate a program written in a high-level language into machine code (object code).

Once compiled (all in one go), the translated program file can then be directly used by the computer and is independently executable.

Compiling may take some time but the translated program can be used again and again without the need for recompilation.

An error report is often produced after the full program has been translated.  Errors in the program code may cause a computer to crash.  These errors can only be fixed by changing the original source code and compiling the program again.

If you need to learn more about high-level languages, visit our Languages page.

Interpreter

Program translates a high-level language program into a separate machine language program

Interpreter programs are able to read, translate and execute one statement at a time from a high-level language program.

The interpreter stops when a line of code is reached that contains an error.

Interpreters are often used during the development of a program.  They make debugging easier as each line of code is analysed and checked before execution.

Interpreted programs will launch immediately, but your program may run slower then a complied file.

No executable file is produced.  The program is interpreted again from scratch every time you launch it.

If you need to learn more about high-level languages, visit our Languages page.

Assembler

Assemblers are used to translate a program written in a low-level assembly language into a machine code (object code) file so it can be used and executed by the computer.

Once assembled, the program file can be used again and again without re-assembly.

If you need to learn more about low-level languages, visit our Languages page.

Summary of translators

CompilerInterpreterAssembler
Translates high-level languages into machine code Temporarily executes high-level languages, one statement at a time Translates low-level assembly code into machine code
An executable file of machine code is produced (object code) No executable file of machine code is produced (no object code) An executable file of machine code is produced (object code)
Compiled programs no longer need the compiler Interpreted programs cannot be used without the interpreter Assembled programs no longer need the assembler
Error report produced once entire program is compiled.  These errors may cause your program to crash Error message produced immediately (and program stops at that point) One low-level language statement is usually translated into one machine code instruction
Compiling may be slow, but the resulting program code will run quick (directly on the processor) Interpreted code is run through the interpreter (IDE), so it may be slow, e.g. to execute program loops
One high-level language statement may be several lines of machine code when compiled

What translates high

A compiler is a computer program that translates a program written in a high-level language to the machine language of a computer.

Which type of program converts a high

A compiler is a translator program which translates a high level programming language into equivalent machine language programs.

What translates program to machine language?

Compiler. Compilers are used to translate a program written in a high-level language into machine code (object code). Once compiled (all in one go), the translated program file can then be directly used by the computer and is independently executable.

Which program translates a program written in assembly language into the machine language?

Assembly code is converted into executable machine code by a utility program referred to as an assembler.