Programming languages have been developed over the year in a phased manner. Each phase of developed has made the programming language more user-friendly, easier to use and more powerful. Each phase of improved made in the development of the programming languages can be referred to as a generation. The programming language in terms of their performance reliability and robustness can be grouped into five different generations,
First generation languages (1GL)
Second generation languages (2GL)
Third generation languages (3GL)
Fourth generation languages (4GL)
Fifth generation languages (5GL)
Assembly language becomes Machine Code
The first generation programming language is also called low-level programming language because they were used to program the computer system at a very low level of abstraction. i.e. at the machine level. The machine language also referred to as the native language of the computer system is the first generation programming language. In the machine language, a programmer only deals with a binary number.
All CPUs have their own specific Instruction set. A programmer would look up a manual and get the codes for each operation (add/sub etc) and write down the binary or hex for that number. For this reason it is very tedious and specialised.
RISC stands for Reduced Instruction Set Computer, and CISC is for Complex Instruction Set Computer. A RISC processor has less instructions, where a complex one may have a larger vocabulary.
Advantages of first generation language
They are translation free and can be directly executed by the computers.
The programs written in these languages are executed very speedily and efficiently by the CPU of the computer system.
The programs written in these languages utilize the memory in an efficient manner because it is possible to keep track of each bit of data.
An Early program
In this old picture, there are 62,500 Punched Cards - containing a mere 5 Megabytes of Code.
What they would do was encode the program onto the cards by punching holes to indicate a zero (no reflection from the light source) and "ones" were "read" where there was no hole punched.
Then they would feed the cards into the card reader one by one (similar to how the voting machines work now). If you dropped the cards - you would be in a lot of trouble, because you only have X machine time allocated for you and you'd have to get them arranged in the right order and restart feeding the machine all over again and try to make it on time before the next programmer kicks you out.
A trivial (in our current standards) program might have required hundreds, if not thousands, of such cards, and hours of machine time to load it and run it.
First ever computer bug
Debugging refers to finding the cause of an error in your program execution.
"First actual case of bug being found," according to the brainiacs at Harvard, 1945.
When they opened the computer’s hardware, they found ... a moth. The trapped insect had disrupted the electronics of the computer.
The engineers who found the moth were the first to literally "debug" a machine.
In late 1948, the Electronic Delay Storage Automatic Calculator (EDSAC) had an assembler (named "initial orders") integrated into its bootstrap program. It used one-letter mnemonics developed by David Wheeler, who is credited by the IEEE Computer Society as the creator of the first "assembler". It meant that a programmer could write code using something like English, and a program would convert this to machine code. It also meant that code could be assembled to run on different hardware, as long as an assembler was created for that hardware.
The second generation programming language also belongs to the category of low-level- programming language. The second generation language comprises assembly languages that use the concept of mnemonics for the writing program. In the assembly language, symbolic names are used to represent the opcode and the operand part of the instruction.
Advantages of second generation language
It is easy to develop understand and modify the program developed in these languages are compared to those developed in the first generation programming language.
The programs written in these languages are less prone to errors and therefore can be maintained with a great case.
The image above shows an imaginary list of machine instructions, along with what they might look like in assembly. Do not worry about the details of this particular assembly language or machine language, just recognize that each instruction is just a translation of the machine code. Each “LOAD” instruction corresponds to a machine instruction that starts with the opcode 001 which means load; each “STORE” instruction corresponds to a machine instruction that starts with the opcode 010.
Although assembly is much easier to read than machine code, you probably noticed that it is still very low level. A job as simple as “add 2 and 5” took many instructions to express. For this reason, most programmers do not work in assembly most of the time.
The third generation programming languages were designed to overcome the various limitations of the first and second generation programming languages. The languages of the third and later generation are considered as a high-level language because they enable the programmer to concentrate only on the logic of the programs without considering the internal architecture of the computer system.
Advantages of third generation programming language
It is easy to develop, learn and understand the program.
As the program written in these languages are less prone to errors they are easy to maintain.
The program written in these languages can be developed in much less time compared to the first and second generation language.
Examples: FORTRAN, ALGOL, COBOL, C++, C, Python, Java
the same program in pascal and python
Most popular languages of 2023 (stackoverflow)
The fourth generation programming languages were designed and developed to reduce the time, cost and effort needed to develop different types of software applications. A fourth generation (programming) language (4GL) is a grouping of programming languages that attempt to get closer than 3GLs to human language, form of thinking and conceptualisation.
4GLs are designed to reduce the overall time, effort and cost of software development. The main domains and families of 4GLs are: database queries, report generators, data manipulation, analysis and reporting, screen painters and generators, GUI creators, mathematical optimisation, web development and general purpose languages.
Also known as a domain specific language, or a high productivity language.
Advantages of fourth generation languages
These programming languages allow the efficient use of data by implementing the various database.
They require less time, cost and effort to develop different types of software applications.
The program developed in these languages are highly portable as compared to the programs developed in the languages of other generation.
Examples: SQL, Oracle Reports, LabVIEW
Oracle Reports
LabVIEW
The programming languages of this generation mainly focus on constraint programming. The major fields in which the fifth generation programming language are employed are Artificial Intelligence and Artificial Neural Networks
Advantages of fifth generation languages
These languages can be used to query the database in a fast and efficient manner.
They allow the users to communicate with the computer system in a simple and easy manner.
Programmers can use normal English words while interacting with the computer system.
Examples: prolog, mercury
Prolog
This is an example of Prolog. The PIE mentioned is the Prolog Inference Engine.
Here. we tell the program some information and can then create a query that the program attempts to infer the answer based on the info and the rules given to it.
In the example here, we create four instances of parent, where the person, gender is specified to have a parent, gender coupling. Next we specify what a grandFather and a father is.
Asking then who is a grandFather to Pam, tells us that she has two grandfathers. This is inferred because:
Pam's parents are Bill and Jane.
Bill's male parent is John, and Jane's male parent is Joe, therefore the AI can deduce who Pam's grandfathers are.