1. Meaning of Programming Language
A Programming Language is a formal, structured set of instructions, commands, and syntax rules used to communicate with a computer and develop software applications. It acts as an intermediary between human thought and machine execution, allowing a programmer (the user) to define a sequence of operations for the computer to perform. The primary purpose of a programming language is to provide a clear and efficient way to create programs that control the behavior of a machine, process data, and solve specific computational problems.
According to the AIOU textbook (Unit 9), a programming language is defined as:
“A programming language is a set of commands, instructions, and other syntax use to create a software program. Languages that programmers use to write code are called ‘high-level languages.’ This code can be compiled into a ‘low-level language,’ which is recognized directly by the computer hardware.”
At its core, a program written in a programming language must ultimately be translated into the machine language (binary code of 0s and 1s) that the computer’s central processing unit (CPU) can understand and execute directly.
2. Types of Programming Languages
Programming languages can be classified based on their level of abstraction from the machine hardware and their generation in the historical evolution of computing. The textbook (Unit 9) categorizes them as follows:
A. Classification by Generation:
- First Generation Language (1GL) – Machine Language: This is the lowest-level language, consisting entirely of binary numbers (
0and1). It is the only language the CPU understands directly. It is machine-dependent, very difficult for humans to read and write, and prone to errors. - Second Generation Language (2GL) – Assembly Language: This language uses symbolic codes called mnemonics (e.g.,
ADD,SUB,MOV) to represent machine instructions. It is specific to a particular computer architecture. An assembler is required to translate assembly code into machine code. - Third Generation Language (3GL) – High-Level Languages: These languages use English-like words and mathematical notations (e.g.,
if,while,print), making them much easier for programmers to learn and use. They are largely machine-independent. Examples include FORTRAN, COBOL, C, C++, and Java. A compiler or interpreter is needed to translate 3GL code into machine code. - Fourth Generation Language (4GL) – Very High-Level Languages: Designed for specific applications, these languages are even more user-friendly and closer to human language. They are often used for database management and report generation. They require significantly fewer lines of code than 3GLs. Examples include SQL (Structured Query Language) for databases and some report-generating tools.
- Fifth Generation Language (5GL) – Natural Language Languages: These are designed to allow programmers to write programs using constraints and rules based on human (natural) language. The goal is to create software by describing what the program should do, rather than detailing how to do it. They are used primarily in artificial intelligence (AI) and expert systems research.
B. Classification by Programming Paradigm/Type:
The textbook also hints at another classification based on the language’s purpose and design:
- Machine-Oriented Languages: Low-level languages like Machine Language and Assembly Language.
- Problem-Oriented Languages: High-level languages designed to solve problems in specific domains (e.g., FORTRAN for science, COBOL for business).
3. Explanation of Three Programming Languages
Here is a detailed explanation of three key languages from different generations as covered in the AIOU textbook:
i) Machine Language (First Generation Language)
- Definition & Nature: Machine language is the fundamental, native language of a computer. It is the only programming language that does not require any translation, as the CPU’s circuitry is designed to execute these instructions directly.
- Composition: It consists solely of binary digits (bits) –
0(representing OFF or low voltage) and1(representing ON or high voltage). These bits are grouped into meaningful instructions and data (e.g.,10110000 01100001might mean “load the value 61 (hex) into the accumulator register”). - Characteristics:
- Machine-Dependent: A program written in machine language for one type of CPU (e.g., Intel) will not run on a computer with a different CPU architecture (e.g., ARM).
- Difficult for Humans: Writing, reading, debugging, and modifying programs in pure binary is extremely tedious and error-prone for programmers.
- Efficient Execution: Since it runs directly on the hardware, it can be very fast and efficient in terms of execution speed and memory usage.
- Example: A simple task to add two numbers would require writing a long sequence of binary codes specific to the CPU’s instruction set.
- Historical Context: The earliest computers of the First Generation (1951-1958), such as UNIVAC and EDVAC, were programmed directly in machine language using panels of switches or punched cards.
ii) Assembly Language (Second Generation Language)
- Definition & Nature: Assembly language was developed as a significant improvement over machine language. It uses mnemonic codes and symbolic addresses to represent machine instructions and memory locations, making it slightly more human-readable.
- Composition: Instead of binary, it uses short abbreviations. For example,
ADDfor addition,SUBfor subtraction,LOADto bring data from memory,STORto save data to memory. It also allows the use of labels (likeLOOP:orTOTAL:) to mark parts of the code. - Translation: A program called an Assembler translates the assembly language program (source code) line-by-line into an equivalent machine language program (object code).
- Characteristics:
- Low-Level & Machine-Specific: Like machine language, it is tied to a specific processor family. An assembly program for an Intel processor cannot run on a Motorola processor.
- Efficient: It allows for highly optimized code that is very fast and uses system resources (memory, CPU cycles) efficiently. It is often used for writing device drivers, embedded systems, and real-time systems.
- Easier than Machine Language: While still complex, it is easier to write and debug than raw binary.
- Example:
ADD A, Bmight be an assembly instruction to add the value in register B to register A. The assembler converts this mnemonic into the appropriate binary instruction. - Historical Context: It became prominent during the Second Generation of computers (1959-1964), which used transistors. It made programming more accessible compared to the first generation.
iii) FORTRAN (Third Generation Language – High-Level Language)
- Definition & Nature: FORTRAN (FORmula TRANslator) is one of the oldest and most influential high-level programming languages. It was specifically designed by a team at IBM led by John Backus for scientific, engineering, and mathematical computations.
- Composition: It uses familiar mathematical formulas and English-like keywords. For example,
X = Y + ZorIF (A .GT. B) THEN. - Translation: Programs written in FORTRAN are translated into machine code using a Compiler. The compiler reads the entire source code, checks for syntax errors, and generates a complete machine code executable file.
- Characteristics:
- Machine Independence (Portable): A FORTRAN program can, in principle, be compiled and run on different types of computers with a FORTRAN compiler for that system.
- Ease of Use: Its syntax is much closer to mathematical notation and human language, making complex numerical algorithms easier to express and understand than in assembly.
- Efficiency: FORTRAN compilers are famously good at producing highly optimized code for numerical calculations, which is why it remains in use today in high-performance computing (HPC), climate modeling, and computational physics.
- Structured: While early FORTRAN (like FORTRAN 66/77) used line numbers and
GOTOstatements, modern versions (Fortran 90/95/2003) support structured and modular programming.
PROGRAM AVERAGE
REAL :: NUM1, NUM2, SUM, AVG
NUM1 = 10.5
NUM2 = 20.5
SUM = NUM1 + NUM2
AVG = SUM / 2.0
PRINT *, 'The average is: ', AVG
END PROGRAM AVERAGE- Historical Context: Developed in the 1950s, it became the dominant language for scientific computing during the Third Generation of computers (1965-1970). Its success demonstrated the practicality and power of high-level languages.
Conclusion:
The evolution from Machine Language to Assembly Language to High-Level Languages like FORTRAN represents a constant drive in computer science to increase abstraction. Each step moved programmers further away from the intricate details of the hardware, allowing them to focus more on the logic of the problem itself. This progression has made software development faster, less error-prone, and accessible to a vastly larger number of people, fueling the digital revolution. Understanding these fundamental types of languages is crucial for grasping how software communicates with and controls computer hardware.




