C Menu


Computer Languages




Computer Languages

A computer language is a language used by humans to communicate instructions to a computer. Just as people use languages such as English, Hindi, Telugu, and Tamil for communication, programmers use computer languages to give instructions to computers.

Definition

Computer language: A language used by a programmer to communicate with a computer and provide instructions for performing specific tasks.

Every programming language has a set of rules called syntax. Syntax defines how keywords, symbols, operators, and statements must be written. It is similar to the grammar rules used in natural languages.

Classification of Computer Languages

Computer languages can be broadly classified into the following three types:

  1. Machine Language
  2. Symbolic Language (Assembly Language)
  3. High-Level Language

1) Machine Language

Machine language is the lowest-level computer language. It consists of instructions represented using binary digits, 0 and 1. Since computers understand binary instructions directly, machine-language programs can be executed without an additional language translator.

Example:

10110000 01100001

Machine language is specific to a particular processor or computer architecture.

Advantages:

  • Programs can be executed directly by the computer.
  • Execution is very fast because no language translation is required.
  • Programs can make efficient use of system resources.

Disadvantages:

  • Writing programs in binary form is very difficult.
  • Machine instructions are difficult to remember.
  • Programs are machine dependent.
  • Debugging and maintaining programs is difficult.

2) Symbolic Language (Assembly Language)

Symbolic language, commonly called assembly language, uses symbols and mnemonics instead of binary instructions. Mnemonics are short, meaningful abbreviations that are easier for programmers to remember.

Examples of mnemonics:

MOV
ADD
SUB
JMP

An assembler is used to translate an assembly-language program into machine language so that the processor can execute it.

Advantages:

  • Easier to read and write than machine language.
  • Mnemonics are easier to remember than binary instructions.
  • Provides better control over hardware resources.
  • Can produce efficient and fast programs.

Disadvantages:

  • Assembly language is generally machine dependent.
  • Programs are more difficult to develop than high-level programs.
  • Knowledge of computer architecture is required.
  • An assembler is required to convert the program into machine code.

3) High-Level Languages

High-level languages are programming languages designed to be easier for humans to read, write, and understand. Their syntax is closer to natural language and mathematical notation than machine language or assembly language.

Examples include C, C++, Java, Python, R, FORTRAN, COBOL, and Pascal. High-level languages generally provide control structures, input/output facilities, functions, and other features that make software development easier.

Advantages:

  • Easy to learn, read, write, and understand.
  • Programs are easier to test, debug, and maintain.
  • Requires less development time.
  • Many high-level languages support portability across different systems.
  • Provides useful libraries and programming features.

Disadvantages:

  • Programs cannot normally be executed directly by the processor.
  • A translator such as a compiler or interpreter is required.
  • Some low-level hardware operations may be less directly accessible.

Language Translators

A language translator converts a program written in one language into a form that the computer can execute.

  • Assembler: Converts an assembly-language program into machine code.
  • Compiler: Translates a high-level program into machine code or another lower-level form, generally processing the program as a whole.
  • Interpreter: Translates and executes program instructions one by one during execution.

Comparison of Computer Languages

FeatureMachine LanguageAssembly LanguageHigh-Level Language
RepresentationBinary (0 and 1)Mnemonics and symbolsEnglish-like statements and symbols
Ease of programmingVery difficultModerately difficultEasy
TranslatorNot requiredAssemblerCompiler or Interpreter
Machine dependencyMachine dependentMachine dependentGenerally more portable
ReadabilityVery lowBetter than machine languageHigh

Summary

Machine language is directly understood by the processor and is represented using binary digits. Assembly language uses mnemonics and requires an assembler for translation. High-level languages are designed for programmer convenience and require a compiler or interpreter for execution. Therefore, as we move from machine language to high-level language, programming generally becomes easier, more readable, and more maintainable.

Key Points

  • Computer languages are used to communicate instructions to computers.
  • Syntax defines the rules for writing programs correctly.
  • Machine language uses binary instructions.
  • Assembly language uses mnemonics.
  • An assembler converts assembly language into machine code.
  • High-level languages are easier for humans to understand.
  • Compilers and interpreters are commonly used with high-level languages.

Next Topic :Creating and Running