Types of Programming Languages: 1. Low Level Language
Types of Programming Languages: 1. Low Level Language
There are two types of programming languages, which can be categorized into the following
ways:
1. Low level language
A. Machine language (1GL)
B. Assembly language (2GL)
2. High level language
A. Procedural-Oriented language (3GL)
B. Problem-Oriented language (4GL)
C. Natural language (5GL)
1. Low level language
This language is the most understandable language used by computer to perform its operations. It
can be further categorized into:
A. Machine Language (1GL)
Machine language consists of strings of binary numbers (i.e. 0s and 1s) and it is the only one
language, the processor directly understands. Machine language has an Merits of very fast
execution speed and efficient use of primary memory.
Merits:
It is directly understood by the processor so has faster execution time since the programs
written in this language need not to be translated.
It doesn’t need larger memory.
Demerits:
It is very difficult to program using 1GL since all the instructions are to be represented by
0s and 1s.
Use of this language makes programming time consuming.
It is difficult to find error and to debug.
It can be used by experts only.
B. Assembly Language
Assembly language is also known as low-level language because to design a program
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 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 programming process faster.
Error can be identified much easily compared to 1GL.
It is easier to debug than machine language.
Demerits:
Programs written in this language is not directly understandable by computer so
translators should be used.
It is hardware dependent language so programmers are forced to think in terms of
computer’s architecture rather than to the problem being solved.
Being machine dependent language, programs written in this language are very less or
not portable.
Programmers must know its mnemonics codes to perform any task.
2. High level language
Instructions of this language closely resembles to human language or English like words. It uses
mathematical notations to perform the task. The 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:
A. 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 a
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,
FORTAN, etc.
Merits:
Because of their flexibility, procedural languages are able to solve a variety of problems.
Programmer does not need to think in term of computer architecture which makes them
focused on the problem.
Programs written in this language are portable.
Demerits:
It is easier but needs higher processor and larger memory.
It needs to be translated therefore its execution time is more.
B. 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 from 3GL. These are
result oriented and include database query language.
Eg: Visual Basic, C#, PHP, etc.
The objectives of 4GL are to:
Ø Increase the speed of developing programs.
Ø Minimize user’s effort to obtain information from computer.
Ø Reduce errors while writing programs.
Merits:
Programmer need not to think about the procedure of the program. So, programming is
much easier.
Demerits:
It is easier but needs higher processor and larger memory.
It needs to be translated therefore its execution time is more.
C. Natural language (5GL)
Natural language are still in developing stage where we could write statements that would look
like normal sentences.
Merits:
Easy to program.
Since, the program uses normal sentences, they are easy to understand.
The programs designed using 5GL will have artificial intelligence (AI).
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.
A programming language must be simple, easy to learn and use, have good
readability and human recognizable.
Abstraction is a must-have Characteristics for a programming language in which
ability to define the complex structure and then its degree of usability comes.
A portable programming language is always preferred.
Programming language’s efficiency must be high so that it can be easily converted
into a machine code and executed consumes little space in memory.
A programming language should be well structured and documented so that it is
suitable for application development.
Necessary tools for development, debugging, testing, and maintenance of a program
must be provided by a programming language.
A programming language should provide single environment known as Integrated
Development Environment (IDE).
A programming language must be consistent in terms of syntax and semantics.
The first two generations are called low level languages. The next three generations are
called high level languages.
Low Level Vs High Level programming languages
1) Platform Dependencies
First, you should know about the platform, here platform means Computer Hardware (Computer
configuration).
Low Level programming languages are platform dependent that means programs written in Low
Level language can run on the same hardware with same configuration, you cannot run them on
hardware that has different configuration.
High Level programming languages are platform independent that means programs written in
High Level language can run on different hardware with different configuration.
Remember: High Level programming languages are platform independent that doesn’t mean
they are operating system independent. System hardware configuration may be different but
Operating systems should be same.
2) Speed
Low Level language programs are faster than High Level language programs as they do not need
to convert.
3) Easiness
Low Level language programs are not as easy as High Level language. There are only two Low
Level programming languages Binary and Assembly. Binary has only 0’s, 1’s, while Assembly
has some difficult type symbols which are knows as mnemonics.
But, the High Level languages programs are easy to write, read, modify and understand.
4) Performance
Since, Low Level Languages programs are faster, so performance of Low Level languages
programs are better than the High Level languages programs.
5) Translation
Low Level language Binary does not need translation as Binary codes are Machine codes and
computer understands them without any translations.
6) Flexibilities
High Level languages are flexible to read, edit, debug, understand etc but Low Level Languages
are not so easy to handle.
High Level languages have huge libraries with a rich set of Data types, keywords, functions etc
so these languages are really good to develop an application with many great features using less
effort and resource.
7) Support
Low Level languages have less support than High Level Languages. There may be lesser number
of professionals (community) in support of Low Level languages as comparisons to High Level
Language support.
These are the different types of programming languages translators with their merits and
demerits.
Assembler
An assembler translates assembly language into machine code. Assembly language consists of
mnemonics for machine opcodes so assemblers perform a 1:1 translation from mnemonics to a
direct instruction. For example:
Conversely, one instruction in a high level language will translate to one or more instructions at
machine level.
Compiler
A Compiler is a computer program that translates code written in a high level language to a
lower level language, object/machine code. The most common reason for translating source code
is to create an executable program (converting from a high level language into machine
language).
Source code is not included, therefore compiled code is more secure than interpreted code
Tends to produce faster code than interpreting source code
Produces an executable file, and therefore the program can be run without need of the source
code
Disadvantages of using a compiler
Object code needs to be produced before a final executable file, this can be a slow process
The source code must be 100% correct for the executable file to be produced
Interpreter
An interpreter program executes other programs directly, running through program code and
executing it line-by-line. As it analyses every line, an interpreter is slower than running compiled
code but it can take less time to interpret program code than to compile and then run it — this is
very useful when prototyping and testing code. Interpreters are written for multiple platforms,
this means code written once can be run immediately on different systems without having to
recompile for each. Examples of this include flash based web programs that will run on your PC,
MAC, games console and Mobile phone.
Source code is required for the program to be executed, and this source code can be read
making it insecure
Interpreters are generally slower than compiled programs due to the per-line translation
method
What is Translators? Different type of translators
A program written in high-level language is called as source code. To convert the source code
into machine code, translators are needed.
A translator takes a program written in source language as input and converts it into a program in
target language as output.
• Translating the high-level language program input into an equivalent machine language
program.
• Providing diagnostic messages wherever the programmer violates specification of the high-
level language program.
Compiler
Interpreter
Assembler
Assembler is a translator which is used to translate the assembly language code into machine
language code.
A translator is a programming language processor that converts a computer program from one language
to another. It takes a program written in source code and converts it into machine code. It discovers and
identifies the error during translation.
Purpose of Translator
It translates high-level language program into a machine language program that the central
processing unit (CPU) can understand. It also detects errors in the program.
Compiler
Interpreter
Just like a compiler, is a translator used to convert high-level programming language to low-level
programming language. It converts the program one at a time and reports errors detected at
once, while doing the conversion. With this, it is easier to detect errors than in a compiler. An
interpreter is faster than a compiler as it immediately executes the code upon reading the code.
It is often used as a debugging tool for software development as it can execute a single line of
code at a time. An interpreter is also more portable than a compiler as it is not processor-
dependent, you can work between hardware architectures.
Assembler
Translator Examples
Microsoft Visual Studio
Compiler GNU Compiler Collection (GCC)
Common Business Oriented Language (COBOL)
OCaml
Interpreter List Processing (LISP)
Python
Fortran Assembly Program (FAP)
Assembler Macro Assembly Program (MAP)
Symbolic Optimal Assembly Program (SOAP)
You discover errors before you complete the program, so you learn from your mistakes.
Program can be run before it is completed so you get partial results immediately.
You can work on small parts of the program and link them later into a whole program.
The symbolic programming is easier to understand thus time-saving for the programmer.
It is easier to fix errors and alter program instructions.
Efficiency in execution just like machine level language.
Ada, Algol, BASIC or Basic, C, C++, C#, COBOL or Cobol, FORTH or Forth, FORTRAN or Fortran,
Haskell, Java, LISP, LOGO, Pascal, Perl, PL/1, Postscript, PROLOG or Prolog, RPG, Simula, Smalltalk,
SNOBOL, SQL
Visual Basic
Delphi
C
C++
C#
Cobol
Fortran
Objective-C
Swift
Pascal
Python
Javascript
Perl
PHP
Postscript
Python
Ruby
Translators
Computers only understand machine code (binary), this is an issue because programmers prefer
to use a variety of high and low-level programming languages instead.
To get around the issue, the high-level and low-level program code (source code) needs to pass
through a translator. A translator will convert the source code into machine code (object code).
There are several types of translator programs, each able to perform different tasks.
Compiler
Compilers are used to translate a program written in a high-level language into machine code
(object code).
Once compiled (all in one go), the translated program file can then be directly used by the
computer and is independently executable.
Compiling may take some time but the translated program can be used again and again without
the need for recompilation.
An error report is often produced after the full program has been translated. Errors in the
program code may cause a computer to crash. These errors can only be fixed by changing the
original source code and compiling the program again.
Interpreter
Interpreter programs are able to read, translate and execute one statement at a time from a high-
level language program.
The interpreter stops when a line of code is reached that contains an error.
Interpreters are often used during the development of a program. They make debugging easier as
each line of code is analyzed and checked before execution.
Interpreted programs will launch immediately, but your program may run slower then a complied
file.
No executable file is produced. The program is interpreted again from scratch every time you
launch it.
Assembler
Assemblers are used to translate a program written in a low-level assembly language into a
machine code (object code) file so it can be used and executed by the computer.
Once assembled, the program file can be used again and again without re-assembly.
Summary of translators
Compiler Interpreter Assembler
Translates high-level languages Temporarily executes high-level Translates low-level assembly
into machine code languages, one statement at a code into machine code
time
An executable file of machine No executable file of machine An executable file of machine
code is produced (object code) code is produced (no object code is produced (object code)
code)
Compiled programs no longer Interpreted programs cannot be Assembled programs no longer
need the compiler used without the interpreter need the assembler
Error report produced once Error message produced One low-level language
entire program is immediately (and program stops statement is usually translated
compiled. These errors may at that point) into one machine code
cause your program to crash instruction
Compiling may be slow, but the Interpreted code is run through
resulting program code will run the interpreter (IDE), so it may
quick (directly on the processor) be slow, e.g. to execute program
loops
One high-level language
statement may be several lines
of machine code when compiled