Programming languages
Programming languages
Jan 6, 2025 1
PROGRAMMING LANGUAGES
Jan 6, 2025 2
Low Level Languages
Low level languages are used to write programs that relate to
the specific architecture and hardware of a particular type of
computer.
They are closer to the native language of a computer (binary),
making them harder for programmers to understand.
Assembly language
Jan 6, 2025 3
Machine language
Machine language is what the computer can understand but
it is difficult for the programmer to understand.
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.
Jan 6, 2025 4
Machine language
Some of the features of machine language are given below :
The computer can understand the programs written in machine
Jan 6, 2025 5
Machine language
Machine language is defined by the hardware of a computer.
It depends on the type of the processor that the computer uses
and is thus machine-dependent. A machine level program
written on one computer may not work on another
computer with a different processor.
Jan 6, 2025 6
Machine language
Advantage of Machine Language:
The only advantage is that program of machine language run
very fast because no translation program is required for the CPU.
Jan 6, 2025 7
Assembly language
Assembly language was developed to overcome some of the many
inconveniences of machine language.
It is considered to be a second-generation language. This is
another low level but a very important language in which operation
codes and operands are given in the form of alphanumeric symbols
instead of 0’s and l’s.
These alphanumeric symbols will be known as mnemonic codes
e.g. ADD for addition, SUB for subtraction etc.
Because of this feature it is also known as ‘Symbolic Programming
Language’.
Small, English-like representation is used to write the program in
assembly language.
Jan 6, 2025 8
Assembly language
Some of the features of a program written in assembly language
are as follows:
Assembly language programs are easier to write than the machine
LOAD A
SUB A,B
Jan 6, 2025 10
Assembly language
Advantages of Assembly Language:
1.The symbolic programming of Assembly Language is easier to
understand and use as compared to machine language.
2. It is easier to correct errors and modify program instructions
compared to machine language.
Jan 6, 2025 11
HIGH LEVEL LANGUAGES
High Level Languages are user-friendly languages which are similar to
English with vocabulary of words and symbols. These are easier to learn
and require less time to write.
Higher level languages are problem-oriented languages because the
instructions are suitable for solving a particular problem.
examples :
COBOL (Common Business Oriented Language) is mostly suitable
for business oriented language where there is very little processing and
huge output. There are mathematical oriented languages
like FORTRAN (Formula Translation) and BASIC (Beginners All-
purpose Symbolic Instruction Code) where very large processing is
required.
Python, C , Java
Jan 6, 2025 12
HIGH LEVEL LANGUAGES
Programs are easier to write, read or understand in high-level
languages than in machine language or assembly language. For
example, a program written in C++ is easier to understand than
machine language program.
Programs written in high-level languages is the source code which
is converted into the object code using translator software like
interpreter or compiler.
A line of code in high-level program may correspond to more than
one line of machine code.
Program written in high-level languages are easily portable from
one computer to another.
Jan 6, 2025 13
HIGH LEVEL LANGUAGES
Advantages of High Level Languages:
User-friendly
language and therefore can run on any computer for which there exists an appropriate
translator.
It is independent of the machine on which it is used i.e. Programs developed in high
level language can be run on any Computer. (Program written in high-level languages
are easily portable from one computer to another.)
Jan 6, 2025 14
HIGH LEVEL LANGUAGES
Jan 6, 2025 15
TRANSLATOR SOFTWARE (PROGRAM
TRANSLATORS)
A computer can only understand programs defined using machine
code.
Consequently, a program written in a high level language cannot be
run directly.
To execute a computer program written in high or low level
language, it must be translated. There are 3 types of system software
used for translating the code that a programmer writes into a form
that the computer can execute (i.e. machine code). These are:
1. Assembler
2. Compiler
3. Interpreter
Jan 6, 2025 16
TRANSLATOR SOFTWARE
Jan 6, 2025 17
TRANSLATOR SOFTWARE
A program written in a particular programming language is
known as source code.
To execute the program, it must be translated into machine
language, ie the language that the computer understands.
The translated program is called the object code.
Assembler converts a program written in assembly
language to machine language.
Compiler and interpreter convert a program written in
high-level language to machine language.
Jan 6, 2025 18
1.Assembler
Assembly language is also referred to as a symbolic
representation of the machine code.
Jan 6, 2025 19
1.Assembler
Advantages of using an Assembler:
Very fast in translating assembly language to machine code as 1 to 1
relationship
Assembly code is often very efficient (and therefore fast) because it is a low
level language
Assembly code is fairly easy to understand due to the use of English-like
mnemonics
Disadvantages of using Assembler:
Assembly language is written for a certain instruction set and/or processor
Assembly tends to be optimised for the hardware it's designed for, meaning it is often
1 Compiler looks at the entire source code. Interpreter looks at a source code
line-by-line.
3 Program need not be compiled every time Every time higher level program is
converted into lower level program
4 During execution of an object code, the For interpretation, both interpreter and the
compiler is not required. source code is required during execution.
5 It takes large amount of time to analyze the It takes less amount of time to analyze the
source code but the overall execution time source code but the overall execution time
is comparatively faster. is slower.
6 Errors are displayed after entire Errors are displayed for every
program is checked instruction interpreted (if any)
7 Programming language like C, C++ use Programming language like Python, use
compilers. interpreters.