Programming Languages

Programming Languages:

A programming language is a set of rules that tells the computer what operations to do. The programmers use these languages to create other kinds of software. Many programming languages have been written to solve particular kinds of problems. These languages have one thing in common, these must be reduced to digital form- a 1 or 0, electricity on or off- because that is all the computer can work with. Many programming languages have been developed over the years, categorized into various generations based on their interaction with computers.

First Generation Languages (1GLs):

The first generation language is also known as the machine language or the binary language. A program written in machine language is a collection of binary digits or bits that the computer reads and interprets. It is a system of instructions and data executed directly by a computer’s CPU. It is also referred to as machine code or object code. It is written as strings of 0’s and 1’s. It is generally used for complex applications such as space control systems, nuclear reactors, and chemical processing.

Writing a program in a machine language was cumbersome as all the data in computers was given in 0’s and 1’s form. This was a complex process as codes produced for a simple program can run into thousands of pages. For example, suppose you wish to write a program that takes the names of 100 students in your class. Here, suppose a student’s name is “MOTI”, writing this name in binary will be very long.

Machine Language Example

You can well imagine that writing the names of 100 students will be a very long and complex process. Due to this problem, these languages were never popular among programmers.

Instructions in a machine language consist of two parts. The first part is the operation code (Opcode) that defines the functions to be performed and the second part is the operand which stores the data on a specify memory location.

Second Generation Languages (2GLs):

The second generation language, also known as the assembly language or the symbolic language, was introduced in the early 1950s to overcome the limitations of the first generation language. Using the first generation language, it was difficult for programmers to understand and memorize various codes for each symbol, digit, and character.

To overcome this problem, the assembly language was developed by International Business Machine (IBM). This language was similar to the English language and used symbols instead of binary numbers to execute instructions. In this language, each symbol is assigned a specific operation. For example, ADD is used for addition, SUB is used for subtraction, and so on. Symbols like ADD and SUB are known as mnemonics. These symbols are easy to understand and remember as compared to their corresponding codes in the machine language. This language is commonly used when speed is essential to perform an operation.

Computers do not understand the assembly language, thus, an assembler is used to translate the assembly language into the machine language. Some common examples of the assembly language are 8085, 8086, and so on.

Third Generation Languages (3GLs):

A high-level or procedural language resembles some human language such as English. For example, COBOL is used for business applications. A procedural language allows users to write in a familiar notation, rather than numbers or abbreviations. Also, unlike machine and assembly languages, most procedural languages are not machine-dependent i.e. they can be used on more than one kind of computer. A few examples are BASIC, COBOL, FORTRAN, C, C++, PASCAL, Java, Visual Basic, C#, and Visual C++.

BASIC: Beginner’s All-purpose Symbolic Instruction Code.
COBOL: Common Business Oriented Language.
FORTRAN: FORmula TRANslation.

High-level languages are not understandable to computers directly hence, a compiler or an interpreter is required to translate the high-level language into the machine language. Note that every high-level language has its own compiler or interpreter.

Compiler: is used to convert a program written in a high-level language (like C or PASCAL) into a machine language. A compiler translates a user-written program into a machine language in one go. Note that after translation, the compiler reports all the errors of the program along with the line numbers. Once the translation is complete, a linker is used to convert the machine code into executable code.

Interpreter: converts a high-level language program (like Visual Basic) into the machine code line-by-line. It converts one line, if there is no syntax error it will execute this line and if there is no logical error it goes to the second line and repeats these steps till all the statements are converted and executed. The whole cycle is alternately converting and executing the program statements till it reaches the end of the program or tills it encounters an error.

Compiled languages are better than interpreted languages as they can be executed faster and more efficiently once the object code has been obtained. On the other hand, interpreted languages do not need to create object code and so are usually easier to develop and test

Fourth Generation Languages (4GLs):

The fourth generation languages are also known as non-procedural or problem-oriented or Very high-level languages. Non-procedural languages do not describe the logic of programs, but rather focus on the need of programmers. In other words, these languages emphasize “what is required” rather than “how to perform”. One of the commonly used fourth generation languages is the Structured Query Language (SQL).

These languages are easier to use and are commonly used for databases (collection of interrelated records). These languages require fewer instructions to accomplish a specific task. Fourth generation languages are classified into three categories:

  • Report Generators: It is also known as a report writer, is a program for end-users that produces a report. The report may be a printout or a screen display. It may show all or part of a database file. We can specify the format in advance columns, headings, etc. and the report generator will then produce data in that format.
  • Query Languages: A query language is an easy-to-use language for retrieving data from a database management system. The query may be given in the form of a sentence or near-English command. Or the query may be obtained from choices on a menu. Examples of query languages are SQL (Structured Query Language), Prolog, and Intellect.
  • Application Generators: It facilitates users to write programs according to their requirements. It allows users to specify only the output-related processing tasks which reduces users’ time.

Fifth Generation Languages (5GLs):

The fifth generation languages are also known as natural languages and it is of two types- the first is ordinary human languages like English, Spanish, etc. and the second is programming languages that use human language to provide people a more natural connection with computers. Natural languages are still in the developmental stages, but they promise to have profound effects, particularly in the areas of artificial intelligence (AI) and expert systems. AI (Artificial Intelligence) is a group of related technologies that attempt to develop machines capable of emulating human-like qualities, such as learning, reasoning, communicating, seeing, and hearing.

Procedure-Oriented Programming
Modular Programming
Object-Oriented Programming (OOP)
C++ Character Set and Program Structure
FOR Loop in C Language

Comments (No)

Leave a Reply