codescracker


computer fundamental

Computer Language Translator and its Types



« Previous Tutorial Next Tutorial »

Translator is a computer program that translates program written in a given programming language into a functionally equivalent program in a different language.

Depending on the translator, this may involve changing or simplifying the program flow without losing the essence of the program, thereby producing a functionally equivalent program.

Types of Language Translator

There are mainly three Types of translators which are used to translate different programming languages into machine equivalent code:

  1. Assembler
  2. Compiler
  3. Interpreter

Assembler

An assembler translates assembly language into machine code.

Assembly language consists of Mnemonics for machine Op-codes, so assemblers perform a 1:1 translation from mnemonic to a direct instruction. For example, LDA #4 converts to 0001001000100100.

Conversely, one instruction in a high level language will translate to one or more instructions at machine level.

Advantages of using Assembler

Here are list of advantages of using assembler:

Disadvantages of using Assembler

Assembly language is written for a certain instruction set and/or processor.

Assembly tends to be optimised for the hardware it is designed for, meaning it is often incompatible with different hardware.

Lots of assembly code is needed to do relatively simple task, and complex programs require lots of programming time compiler.

Compiler

Compiler is a computer program that translates code written in a high level language to a low level language, object/machine code.

The most common reason for translating source code is to create an executable program (converting from high level language into machine language).

Advantages of using Compiler

Below are the list of advantages of using compiler:

Disadvantages of using Compiler

Below are the list of disadvantage of using compiler:

Interpreter

An interpreter program execute other programs directly, running through program code and executing it line-by-line. As it analyses every line, an interpreter is slower than running compiled code but it can take less time to interpret program code than to compile and then run it. This is very useful when prototyping and testing code.

Interpreters are written for multiple platforms, this means code written once can be run immediately on different systems without having to recompile for each. Examples of this include flash based web programs that will run on your PC, Mac, games console and mobile phone.

Advantages of using Interpreter

Here are the list of some main advantages of using an interpreter:

Disadvantages of using Interpreter

And here are the list of some main disadvantages of using an interpreter:


« Previous Tutorial Next Tutorial »








Tools
Calculator

Quick Links
Signup - Login - Give Online Test