Table of Contents

A language is a system of communication. A programming language is a formal constructed language designed to communicate instruction to a machine, particularly a computer. In the earlier computers, low level languages like machine language and assembly language were used. Nowadays, high level languages are used.

Evolution of Programming Language

Evolution of programming language can be seen as:

  1. First Generation (1940-50) – Machine Language
  2. Second Generation (1950-58) – Assembly Language
  3. Third Generation (1958-85) – COBOLFORTRANBASICPL/I
  4. Fourth Generation (1985 onwards) – C, C++, ALGOL, Oracle, Java, SQL

Low Level Languages

Low level languages can be classified as: 

1. Machine Language –

All digital computers work on the basics of binary numbers (0 and 1). The instructions given in binary numbers, which the computer understands are called the ‘machine Code’ or ‘Machine Language’. Machine language is the basic language but programming in this language is very difficult and time consuming. It is the only language which the computer understands without translation. Programmes written in machine language can only be used on the computer model for which that language is written. That’s why this language is called machine-oriented. It is rarely used for programming nowadays.

Merits of Machine Language:

  1. Maximum Hardware Efficiency: Since instructions are written in the CPU's native binary code, there is no overhead. You can optimize programs to use the absolute minimum amount of RAM and register space.
  2. Zero Latency Execution: Because the code is already in a format the processor understands, it is immediately executable. It bypasses the "translation tax" imposed by compilers (like C++) or interpreters (like Python).
  3. Granular Bit-Level Manipulation: It allows for the direct manipulation of individual bits and bytes. This is critical for writing low-level drivers, managing memory-mapped I/O, or performing specialized cryptographic operations.
  4. Predictable Performance: Without a compiler making "smart" decisions or a garbage collector running in the background, the execution time of machine code is highly deterministic.

Demerits of Machine Language:

  1. Platform Dependency (Lack of Portability): Machine language is tied to a specific Instruction Set Architecture (ISA) (e.g., x86 vs. ARM). Code written for an Intel processor will not run on an Apple M3 chip or a micro-controller without being completely rewritten.
  2. High Cognitive Load: Humans do not think in hex or binary. Memorizing hundreds of opcodes (e.g., 10110000 for "Move") is prone to extreme mental fatigue and error.
  3. Complexity in Maintenance and Debugging: Finding a logical error in a sea of 1s and 0s is famously difficult. Because there are no variable names or structured loops (only jumps to memory addresses), "tracing" the logic of a program is a manual, grueling process.
  4. Manual Memory Management: The programmer is responsible for tracking every memory address. One slight mistake can lead to system crashes or data corruption, as there are no built-in safety nets or "bounds checking" found in higher languages.

2. Assembly Language –

The language which substitutes letters and symbols for the numbers in the machine program is called an ‘assembly language’ or ‘symbolic language’.

Components of Assembly Language:

Below are the core components of Assembly Language:

  1. Assembly Code / Symbolic Programs: a program written in symbolic language that uses symbols instead of numbers is called an ‘assembly code’.
  2. Assembler: the translator program that translates an assembly code into the computer’s machine code is called an assembler. It is a system program which is supplied by the computer manufacturer. It is called ‘assembler’ because in addition to translating the assembly code into machine code, it also assembles the machine code into the main memory of the computer.
  3. Source Program: a symbolic program written by a programmer in assembly language is called source program.
  4. Object Program: after the source program has been converted into machine language by an assembler, it is referred to as an object program.

Merits of Assembly Language:

  1. Better than Machine Code for Memory Management: While you do have to manage memory, Assembly allows you to use symbolic labels (like START or DATA_VAL) instead of memorizing raw hex addresses (like 0x004F). This makes it significantly easier to track locations compared to machine language.
  2. Maximum Efficiency: This is its greatest strength. Assembly provides direct control over the CPU and registers, leading to highly optimized execution speeds and minimal RAM consumption.
  3. Easier Maintenance (Relative to Machine Code): It is easier to modify than machine language because it uses mnemonics (like MOV, ADD, PUSH) rather than binary strings.
  4. Direct Hardware Manipulation: It allows programmers to perform specific tasks that high-level languages might restrict, such as writing interrupt service routines or device drivers.

Demerits of Assembly Language:

  1. Development Time: It takes much longer to code than high-level languages (like Python or C++). To do something simple, like printing "Hello World," you might need 20 lines of Assembly versus one line in Python.
  2. Hardware Dependency (Lack of Portability): This is a major drawback. Assembly is written for a specific Instruction Set Architecture (ISA). A program written for an x86 Intel processor will not run on an ARM-based Apple M3 or a RISC-V chip.
  3. High Probability of Errors: Because the programmer handles everything manually. including memory allocation and register management, it is very easy to introduce bugs like memory leaks or stack overflows.

High Level Languages

High level languages were developed to overcome the limitations of low level languages. They are not machine dependent. They are problem oriented. Instructions given in high level languages are known as statements. BASIC, PASCAL, ALGOL, C are the primary high level languages.

High level languages can be classified as:

  1. ALGOL (Algorithmic Language)
  2. BASIC (Beginners All Purpose Symbolic Instruction Code)
  3. FORTRAN (Formula Translations)
  4. COBOL (Common Business Oriented Language)
  5. PL/1 (Programming Language/1)
  6. C Language

Merits of High Level Languages:

  1. Machine Independence (Portability): This is the biggest advantage. A program written in C++ or Java can run on different processor architectures (Intel, ARM, AMD) with little to no change in the source code, as long as a compiler or interpreter exists for that system.
  2. Easy to Learn and Use: HLLs use English-like commands (e.g., if, while, print). This abstraction allows programmers to focus on logic rather than managing CPU registers or memory addresses.
  3. Faster Development and Fewer Errors: Because HLLs automate complex tasks (like memory management), programmers write fewer lines of code. Fewer lines of code statistically lead to fewer bugs, and the code is much easier to read and debug.
  4. User-Friendly Ecosystem: HLLs come with massive libraries and frameworks. If you want to build a website or analyze data, you don't start from scratch; you use pre-written modules.

Demerits of High Level languages:

  1. Lack of Flexibility (Lower Control): Since the language manages hardware interaction automatically, the programmer cannot "tweak" specific CPU behaviors. You cannot usually tell the computer exactly which register to use for a specific calculation, which is sometimes necessary for extreme performance.
  2. Slow Execution Speed: HLLs are not understood directly by the CPU. They must be translated (compiled or interpreted) into machine code. This translation process, and the fact that the resulting machine code is "generalized" rather than hand-tuned, makes them slower than expertly written Assembly.
  3. Higher Resource Consumption (Lower Efficiency): HLLs require more memory (RAM). This is because they often carry "overhead," such as runtime environments or automatic garbage collection (cleaning up memory), which consumes CPU cycles and storage that Assembly wouldn't need.

Object Oriented Languages

Object-oriented languages are programming languages that follow the object-oriented programming (OOP) paradigm. This paradigm centres around the concept of "objects," which are instances of "classes." Objects encapsulate both data (attributes) and the functions that operate on that data (methods).

Fourth generation languages are non-procedural and object oriented in which the programmer has to instruct what to do and what not to do. With the help of these languages, programs can be developed easily.

Common Object Oriented Languages:

  1. C++: This language is developed from C language. It was developed in 1983. Although it is an object oriented language, still it has the attributes for structured programming.
  2. JAVA: It was developed by Sun Micro Systems of USA. It is mostly used for internet applications. It requires JAVA compiler in the computer.
  3. Oracle: It was developed by Oracle Corporation, USA. It is a non-procedural language related to RDBM (Relational Database Management System). SQL (Structured Query Language is used in Oracle.
  4. SQL (Structured Query Language): It is used for database packages like Oracle, Sybase etc. it allows the easy access of the required data from database. Database editing, updating, management has been made quite easy through SQL.

Language Translators

Any program which is not written in machine language has to be translated before it is executed by the computer. Language translators translate the High Level Language or Assembly Language into machine language. They check for some type of errors., if present.

Types of Language Translators:

Language translators are of 3 types: -

  1. Assembler
  2. Compiler
  3. Interpreter

1. Assembler -

An assembler is a low-level translator designed for a specific task: converting Assembly Language into Machine Code (binary). It translates mnemonic opcodes (like MOV or ADD) into their corresponding binary patterns. It generally has a one-to-one correspondence; one line of Assembly usually equals one machine instruction. It checks for syntax errors (e.g., misspelled mnemonics or invalid register names) during the translation process.

2. Compiler -

A compiler translates an entire High-Level Language (HLL) source program into a machine-readable "Object Code" file at once. It scans the whole program and generates an executable file (like an .exe). Once compiled, the program can run repeatedly without needing the compiler again. Execution is very fast because the translation is already finished. It provides a list of all errors found in the entire program at the end of the compilation process. The program will not run until all syntax errors are fixed.

3. Interpreter - 

An interpreter translates High-Level Language code into machine code one line at a time. It reads a line, translates it, and executes it immediately before moving to the next line. It is generally slower than compiled code because the translation happens "on the fly" every time the program is run. It stops execution the moment it encounters an error. This makes it excellent for debugging because the programmer knows exactly which line caused the problem.