Programming Language and its Types

Programming language is the medium of communication between computer and user (programmer). Programming languages are used to develop the computer software.

To give command or to tell a computer what to do, we use programming language. Programming language define a syntax (grammar) to write program instructions.

There are many programming languages like C, C++, Java, etc. Using these programming languages, we can instruct computers to perform any particular task.

Point to be Noted: Software is a collection of programs, whereas, Program is a collection of instruction and command to do some tasks.

Programming Languages

Types of Programming Languages

There are two types of programming languages, which can be categorized into the following ways:

Types of Computer Programming Languages | Ponirevo
Types of Programming Languages

Low Level language

Low-level language is the most understandable language used by computers to perform their operations. It can be further categorized into:

1. Machine Language (1GL)

A machine language consists of strings of binary numbers (i.e. 0s and 1s) and it is the only language, the processor directly understands.

Merits:

  • It is directly understood by the processor so has faster execution time since the programs written in this language need not be translated.
  • It doesn’t need a larger memory or Processing power.

Demerits:

  • It is very difficult to program using 1GL since all the instructions are to be represented by 0s and 1s.
  • Machine-level language is time-consuming to program.
  • It is difficult to find errors and debug them.
  • It can be used by experts only.
  • It is machine-dependent. Hence, the program made for one computer may not work for others.

2. Assembly Language (2GL)

Assembly language is also known as low-level language because to design a program, a programmer requires detailed knowledge of hardware specification.

This language uses mnemonics code (symbolic operation code like ‘ADD’ for addition) in place of 0s and 1s. The program is converted into machine code by an assembler. The resulting program is referred to as an object code.

Merits:

  • It is makes programming easier than 1GL since it uses mnemonics code for programming. Eg: ADD for addition, SUB for subtraction, DIV for division, etc.
  • It makes the programming process faster.
  •  An error can be identified much easily compared to 1GL.
  •  It is easier to debug than machine language.

Demerits:

  • Programs written in this language are not directly understandable by computer so translators should be used.
  •  It is a hardware-dependent language so programmers are forced to think in terms of the computer’s architecture rather than to the problem being solved.
  •  Being a machine-dependent language, programs written in this language are very less or not portable.
  •  Programmers must know its mnemonics codes to perform any task.

High level language

Instructions of this language closely resemble human language or English-like words. It uses mathematical notations to perform the task.

A high-level language is easier to learn. It requires less time to write and is easier to maintain the errors.

The high-level language is converted into machine language by one of the two different languages translator programs: interpreter or compiler.

High level language can be further categorized as:

3. Procedural-Oriented language (3GL)

Procedural Programming is a methodology for modeling the problem being solved by determining the steps and the order of those steps that must be followed in order to reach the desired outcome or specific program state.

These languages are designed to express the logic and the procedure of a problem to be solved. It includes languages such as Pascal, COBOL, C, FORTRAN, etc.

 Merits:

  • Because of their flexibility, procedural languages are able to solve a variety of problems.
  • A programmer does not need to think in terms of computer architecture which makes them focused on the problem.
  • Programs written in this language are portable.

Demerits:

  • It is easier but needs a higher processor and larger memory.
  • It needs to be translated therefore its execution time is more.
  • High-end GUI-based programs cannot be created using 3GL.

4. Problem-Oriented language (4GL)

It allows the users to specify what the output should be, without describing all the details of how the data should be manipulated to produce the result. This is one step ahead of 3GL. These are result-oriented and include database query language.

Eg: Visual Basic, C#, PHP, etc.

Merits:

  • Programmer need not to think about the procedure of the program. So, programming is much easier.
  • Increase the speed of developing programs.
  • Minimize user’s effort to obtain information from computer.
  • Reduce errors while writing programs.

Demerits:

  • It is easier but needs a higher processor and larger memory.
  • It needs to be translated therefore its execution time is more.

5. Natural language (5GL)

A natural language statement’s text is very similar to human speech. These programming languages are also intended to make computers “smarter.”

Any programming language based on problem-solving using constraints provided to the program rather than an algorithm written by a programmer is referred to as a fifth-generation programming language (5GL).

Fifth-generation languages include most constraint-based and logic programming languages, as well as several other declarative languages.

Natural language is still in the developing stage where we could write statements that would look like normal sentences. E.g. Mercury, Prolog, etc.

Merits:

  •  Easy to program.  Since the program uses normal sentences.
  • They are easy to understand and no use of intensive codings.
  • The programs designed using 5GL will have artificial intelligence (AI).
  • The programs would be much more interactive and interesting.

Demerits:

  • It is slower than previous generation language as it should be completely translated into binary code which is a tedious task.
  • Highly advanced and expensive electronic devices are required to run programs developed in 5GL. Therefore, it is an expensive approach.

Compiler, Interpreter and Assembler

1. Compilers

A compiler is a language translator that can be used to translate high-level programs into machine-level language & vice-versa.

A compiler takes the source code as a whole and translates it into object code all in one go. Once converted, the object code can be run at any time. This process is called compilation.

All of the object files used in a program must be combined before the program can be run.

2. Interpreters

The interpreter is also a language translator which can also be used to translate programs from high level to machine level & vice-versa.

An interpreter translates source code into object code one instruction at a time. It is similar to a human translator translating what a person says into another language, sentence by sentence.

The resulting object code is then executed immediately. The process is called interpretation.

3. Assemblers

Assemblers are the third type of translator. The purpose of an assembler is to translate assembly language into object code.

Whereas compilers and interpreters generate many machine code instructions for each high-level instruction, assemblers create one machine code instruction for each assembly instruction.


Syntax, Semantic & Runtime Errors

Errors in Programming Languages

1. Syntax Error

Syntax refers to the structure of a program and the rules about that structure. A syntax error in computer science is an error in the syntax of a coding or programming language, entered by a programmer.

Syntax errors are caught by a software program called a compiler, and the programmer must fix them before the program is compiled and then run.

2. Semantic error 

semantic error occurs when a statement is syntactically valid, but does not do what the programmer intended. If there is a semantic error in your program, it will run successfully in the sense that the computer will not generate any error messages.

However, your program will not do the right thing. It will do something else. This type of error is also called Logical Error.

3. Runtime Error

A runtime error is a program error that occurs while the program is running. This type of error is called runtime error because the error does not appear until you run the program.

These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened. e.g. may be the compatibility of computer

Runtime error may be of several types such as Logical errors, Input/output errors, unknown object errors, division by zero errors, etc.

Print Friendly, PDF & Email
by Rajesh Bhatt
Rajesh is an IT Lecturer with a keen interest in Technological Research over the world. He is equally passionate about Gadgets, Music & Travelling.

2 thoughts on “Programming Language and its Types”

Leave a Comment

Hey, wait!Get Regular Update's

Subscribe Stay Connected, Keep Learning!