Language Translators

Digital Discite - Computer Science XI Notes - File Organization

What is a Language Translator?

Language Translators are programs that convert high-level programming languages (like C, Java) into machine language (binary code – 0s and 1s) so that the computer can understand and execute the instructions.

Why Do We Need Translators?

  • Computers only understand machine language.
  • Programmers write code in high-level or assembly language.
  • Translators convert this code into machine-readable form.

Types of Language Translators

1. Compiler

  • Converts the whole program into machine code at once.
  • If there are any errors, it shows them after translation.

Example Languages: C, C++

Advantages:

  • Fast execution after compilation.
  • Optimized code.

Disadvantages:

  • Difficult to find errors during writing.
  • Needs more memory.

2. Interpreter

  • Converts and runs the program line by line.
  • Shows errors immediately when it finds them.

Example Languages: Python, BASIC

Advantages:

  • Easy to find and fix errors.
  • Good for learning and testing.

Disadvantages:

  • Slower than compiler.
  • Needs to interpret every time the program runs.

3. Assembler

  • Converts assembly language into machine language.

Assembly Language Example: MOV A, B

Advantages:

  • Helps work directly with hardware.
  • Code is fast and small.

Disadvantages:

  • Hard to write and understand.
  • Not portable (works on limited systems).

Comparison Table:

Translator TypeConverts FromConverts ToWorks OnSpeed
CompilerHigh-level languageMachine languageWhole programFast
InterpreterHigh-level languageMachine languageLine by lineSlow
AssemblerAssembly languageMachine languageWhole programFast

Summary Points:

  • Computers need translators to understand human-written code.
  • Three main types: Compiler, Interpreter, and Assembler.
  • Compiler = fast, Interpreter = easy for testing, Assembler = low-level coding.
error: Content is protected !!
Scroll to Top