Types of Computer Programming Languages - Overview

Languages are defined as the communication skill which is used to interact with any person or device. The skill should be such that a proper interaction could be established between the two communicating persons or a person and a device. The microprocessor is a programmable device that recognizes and operates in binary numbers (0's and 1's). Each microprocessor has its own set of instructions based on the hardware design. This instruction set is known as the programming language of that microprocessor. So in this article, we are going to learn about the evolution of programming languages starting from machine language to high-level languages.

Types of Computer Programming Languages

  1. Machine Language
  2. Assembly Language
  3. High-Level Language

Machine Language

Machine language was the first in the evolution of programming languages. A machine language is a binary language that is composed of 0s and 1s. This language is specific to each processor. A microprocessor directly understands a program written in machine language. In fact even today basically microprocessors understand only the 0s and 1s.

A microprocessor recognizes and processes a fixed number of bits at a time. this is named as the word length of the microprocessor. For example, the 8085 microprocessor can recognize and process 8-bit data at a time, hence its word length is 8 bit. the instruction set of the 8085 microprocessor is designed by using various combinations of these eight bits. the 8085 microprocessor has 256 (2^8) such bit patterns but only 74 different bit patterns are used for various operations. these 74 different bit patterns (instructions) are called its instruction set.

Example
  1. 1000 0001 - is an instruction that adds the number in the register named C to the number in the accumulator, and stores the result in the accumulator.
  2. 0111 1000 - is an instruction that copies the number in the register named B to the accumulator.

Sometimes to make the representation easier, hexadecimal codes for bit patterns are used. Hexadecimal codes are easy to write and remember rather than binary codes or patterns. For example, 1000 0001 can be coded as 81 in hexadecimal codes.

Advantages of Machine language

  1. The machine language program is executed faster than a program written in a high-level language program.
  2. No translator and converter are required since the microprocessor directly understands 0s and 1s.

Disadvantages of Machine languages

  1. Difficult to learn and remember.
  2. Programs are lengthy and complex.
  3. Programs are machine-dependent so programs written for one processor may not run on different processors.
  4. Computer architecture and organization must be known before writing the program.

Machine language is rarely used nowadays, except where very high-speed execution is required. it is also used in cheap microcomputer systems.

Assembly Language

The next evolution of programming language was the assembly language. Assembly language uses abbreviated names, called mnemonics, instead of a sequence of 0s and 1s. Since microprocessors can understand only 0s and 1s, the program written in assembly language is not of any use for microprocessors without a translator.

A translator called an assembler translates the assembly language (source program) to machine language (object program).

Types of Computer Programming Languages - Overview - use of assembler

As shown in the given above image the input to an assembler is a source program written in assembly language and its output is an object program that is in machine language. Since the assembler translates each assembly language instruction into an equivalent machine language instruction there is one correspondence between the assembly instruction of the source program and the machine instruction of the object program.

Since mnemonics are only abbreviated names they do not specify the complete operations. the complete description of each instruction must be supplied by the manufacturer. the complete set of 8085 mnemonics is called the 8085 assembly language and a program written in these mnemonics is called an assembly language program.

Example

Machine CodeMnemonicRemark
1000 0001ADD Cis an instruction that adds the number in register named C to the number in the accumulator and stores the result in the accumulator
0111 1000MOV A, Bis an instruction that copies the number in the register named B to the accumulator


An assembly language program written for one microprocessor is not transferable to a computer with another microprocessor unless the two microprocessors are compatible with their machine code.

Advantages of assembly language

  1. Easy to learn and remember.
  2. With a glance through the program, it is much easier to visualize its function of the program.
  3. An Assembly language program is also executed faster than a program written in a high-level language.

Disadvantages of assembly language

  1. The programs are written in assembly language not portable.
  2. Computer architecture and organization must be known before writing the program.
  3. An assembler is needed for translating the assembly language program into machine code.

Similar to machine language, assembly language is rarely used nowadays, except where very high-speed execution is required. both machine language and assembly language are termed low-level language.

High-level language

Even though assembly language was the advanced step in the development of programming language over machine language, both languages are machine-dependent. so the next development in the evolution of programming languages is high-level languages. some examples of high-level languages are as follows
  1. BASIC (Beginners All-Purpose Symbolic Instruction Code)
  2. FORTRAN (Formula Translation)
  3. COBOL (Common Business Oriented Language)

High-level language has its own sets of rules and is written with English words and mathematical symbols. a complete instruction written in a high-level language is known as a statement.

High-level languages are machine-independent os programmer is not supposed to know the details of the computer. Thus the programmer can mainly concentrate on the logic to solve the given problem or to fulfill the application.

Since the microprocessor can understand 0s and 1s only, a converter, which converts the high-level instruction to the binary pattern, is required. A compiler or interpreter is a program that takes English-like statements as to its input and after conversion produces machine language (binary pattern) as its output as shown in the given below image.

Types of Computer Programming Languages - Overview - use of compiler and interpreter

The compiler is a program that translates the whole high-level program into object code (machine code). if it does not find any syntax error. on the other hand, the interpreter reads one instruction at a time, produces its object code, and executes the instruction before reading the next instruction. In the case of the compiler, the object code program is saved for further use of instructions for repetitive processes, whereas in the case of an interpreter, no object code is saved for future use because the translation and execution processes are alternatives.

The compiler is used for larger computers whereas the interpreter is used for small computers. compilers require large main memory as compared to interpreters. Assembler, compiler, and interpreter are put of system software that translates a source program written by the user to an object program that is meaningful to the hardware of the computer or to the microprocessor. These translators are also referred to as language processors since they are used for processing a particular language.

Advantages of high-level language

  1. Easy to learn and remember.
  2. With a glance through the program, it is much easier to visualize its function of the program.
  3. The programmer is needed not to be familiar with the computer architecture and organization.
  4. The program written in a high-level language is portable, provided the other computer has a compiler for the language in which the program is written.
  5. Productivity is enormously increased.

Disadvantages of high-level language

  1. A compiler is required for translating the high-level language program into machine code.
  2. Each high-level instruction is translated into more than one instruction in machine language so it is quite expensive.
  3. The code generated by the compiler might not be as compact as written straightway in the low-level language. Thus a program is written in high-level language usually takes longer to execute.
  4. The knowledge of specifies rules, syntax, and programming techniques for any particularly high-level language is required.
  5. Additional software and hardware support is required.

A high-level language is almost always used nowadays except where very high-speed execution is required. Nowadays nonprocedural languages like Object Oriented Programming languages (OOPs) and Graphical User Interface Languages (GUI) are the most common high-level languages. These can be drawn into different categories of an advanced high-level language. In these languages many commonly used tasks are predefined. user has to simply specify the name of that procedure instead of writing many statements as in the case of a high-level language.

Post a Comment

1 Comments

  1. Thanks for your post. It's very helpful post for us. You can also visit Android Assignment Help for more Victor Steel related information. I would like to thanks for sharing this article here.

    ReplyDelete