What are the different translators — Assembler, Compiler, Interpreter

GT Lakshan
3 min readApr 14, 2022

--

What are the different translators — Assembler, Compiler, Interpreter | TechcyPro
What are the different translators — Assembler, Compiler, Interpreter | TechcyPro

A computer program is a set of commands for machines to perform specific actions. In most cases, computer programs are written in high-level programming languages ( Java, Python, C ) or assembly. These programs are readable and understandable to the programmer, but not to the computer. Therefore, those programs are transformed into machine language, which is intelligible to a computer. The translator is a program designed to translate the program from one language to another. Basically, they translate the program into machine code.

  • Assembler
  • Compiler
  • Interpreter

There are different kinds of translators, which include assembler, compiler, and interpreter. Assembler is is a translator used to translate assembly language to machine language. The compiler and interpreter convert all of the source code of a high-level language into machine language.

01. Assembler

Assembly languages are in the middle of the high-level and machine languages spectrum. This language is not as clear to read and understand for programmers as advanced programming languages. Assembly language has several difficulties, including huge quantities of code, a massive amount of extra small tasks, poor code accessibility, and issues with debugging and adding functionality. Basically, the assembler is the first interface to communicate with the machine.

A translator that converts assembly language to machine language is known as an assembler. To a computer, can understand that language. This is referred to it as “assembling.”

Usages of assembler

  • To develops built-in programs for microcontrollers.
  • For reverse engineering development programs.
  • Assembler is used to program device drivers and some components of operating systems ( The kernel or boot loader. Menuet OS, and Kolibri OS )

02. Compiler

A compiler is a program that acts as a translator between a programmer and a processor. It translates high-level languages into machine code, identifies a couple of errors in the program, and optimizes its operation. If the compiler finds no errors in the source code, it is successfully translated to the target code. When there are any errors in the source code, the compiler specifies the error with the line number at the end of the compilation. These errors must be removed before the compiler can successfully recompile the source code again.

As I said before, there are any syntax or semantic errors, and the program will not run. Because the compiler checks the entire program, the scan time is long, but the execution time is shorter. Therefore, compiler-based languages such as C, C++ are treated as fast languages.

03. Interpreter

Compilers and interpreters are similar in many ways. They also translate high-level language instructions into binary commands that machines can read. After accepting the high-level language code to be executed, the interpreter turns it into intermediate code before translating it to machine instructions. Each piece of code is interpreted and then executed in order, and if an error is discovered inside one part of the code, it stops the code from being interpreted without being translated to the next set of codes.

Examples for interpreter using languages,

  • Python
  • Ruby
  • Perl

Visit my website for subscribe to find more articles.

--

--