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.
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.
Computer languages can be broadly classified into the following three types:
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:
Disadvantages:
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:
Disadvantages:
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:
Disadvantages:
A language translator converts a program written in one language into a form that the computer can execute.
| Feature | Machine Language | Assembly Language | High-Level Language |
|---|---|---|---|
| Representation | Binary (0 and 1) | Mnemonics and symbols | English-like statements and symbols |
| Ease of programming | Very difficult | Moderately difficult | Easy |
| Translator | Not required | Assembler | Compiler or Interpreter |
| Machine dependency | Machine dependent | Machine dependent | Generally more portable |
| Readability | Very low | Better than machine language | High |
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.