Professional Documents
Culture Documents
LANGUAGES
Key-Features
• Complete concept about Machine-Language and Assembly-Languages
Contact us:
[202-RB-Gatti –Faisalabad]
Phone: [+92311-7577374]
Booklet written by:
Email: [workstation6762@gmail.com]
Muhammad Hussnain Khan
Table of Contents DO YOU KNOW?
Programming Languages ....................................................................3
Machine Language
Low Level Languages ........................................................................4 In 1883 Ada Lovelace created an Algorithm
for the Charles Babbage’s Analytical Engine to
Machine Languages ........................................................................4 compute Bernoulli numbers. It is considered to
be first computer programming language.
Assembly Languages ....................................................................4
#Python
Python is an object-oriented, high-level
programming language used in major fields
including Machine Learning and AI, Web
Development, Data Analytics, Game and
Application Development etc. Python ranked
#1 in Jun 2022 listed by TIOBE
2
Programming Language Types of program languages
or
High-level language
High-level language is close to human languages
• A vocabulary and set of grammatical rules for instructing a and are easy to understand. Instruction of these
computer or computing device to perform specific tasks is called languages are written in English-like words such as
programming language input and print etc. A program written in high-level-
language is easier to write and modify.
John Johnson
3
Low-level languages
A low-level programming provides little or no abstraction from computer’s instruction set architecture-commands or functions in the language map
that are structurally similar to processor’s instruction. Because of low abstraction between the language and machine language, low-level languages
1. Machine Language
A type of language in which instructions are written in binary form is called machine language. It is the only language that is directly understood by the
computer. It is the fundamental language of computer. Program written in machine language can be executed very fast by the computer. Programs written
in machine language are machine-dependent. Every computer has it’ s own machine language. Machine language is difficult to understand. Writing and
modifying program in machine language takes a lot of time. Machine language is also known as “first generation language”.
2. Assembly Language
Assembly language is a low-level language. It is one step higher than machine language. In assembly language, symbols are used instead of binary code.
These symbols are called mnemonics. For example, Sub instruction is used to subtract two numbers. Assembly language is also called symbolic language.
Programs are written in assembly language are easier to write and modify than machine language. Assembly language is mostly used for writing system
4
EXAMPLES
Models
5
DO YOU KNOW?
It is real pic of world’s first stored computer program code. The Analytical Engine was a proposed mechanical general-
6
High-level languages
In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer.
In contrast to low-level languages, it may use natural language elements, be easier to use, or may automate (or even hide entirely) significant
areas of computing systems (for example: memory management), making the process of developing a program simpler and more understandable
than when using a low-level language. The amount of abstraction provided defines how “high-level” a programming language is.
In the 1960s, a high-level programming language using a compiler was commonly called auto-code.
➢ Procedural Languages
➢ Object-Oriented Languages
➢ Non- Procedural Languages
7
1. Procedural Languages
Procedural languages are also known third generation language or 3GL. In these languages, a program is a predefined set of instructions. Computer
executes these instructions in the same sequence in which these instructions are written. Each instruction in this language tells the computer what to
do and how to do. Some advantages and disadvantages of procedural languages are given below.
ADVANTAGES DISADVANTAGES
Program statements are similar to English and are easy to learn. The programs execute more slowly.
Less time is required to write programs. These languages use computer resources less efficiently.
Programs are easier to understand and modify. Data is exposed to whole program, so no security for data.
Needs only less memory. Difficult to create new data types reduces extensibility.
8
• Popular Procedural Languages
Some of the most popular procedural languages are as follows:
1. FORTRAN
Fortran is a general-purpose, compiled and imperative programming language that is especially suited to numeric computation and scientific
computing. It was designed by John Backus and IBM in 1957; 65 years ago. FORTRAN stands for Formula Translation. It is mainly
Code example
program average
implicit none
9
write (*,*) "Input number of points to average:"
read (*,*) number_of_points
allocate (points(number_of_points))
ADVANTAGES DISADVANTAGES
• more natural; • missing “modern features” like pointers, novel data structures
• great portability
10
2. BASIC
BASIC stands for Beginner All Purpose Symbolic Instruction Code. It was created in 1963 by John G. Kemeny and Thomas E. Kurtz at
Dartmouth college. They wanted to enable students in non-scientific fields to use computer. It was mainly used by students to use the computer
for solving simple problems. It is easy to understand. It is widely used for education purpose.
Example code
ADVANTAGES DISADVANTAGES
• structure is very simple. • programs cannot be transferred to other operating systems.
• It’s not only a language but an “IDE”. • It cannot handle pointers directly.
11
3. COBOL
COBOL stands for Common business Oriented Language. It is specially designed for business application. It was developed in early 1960s.
The programs written in COBOL are lengthy but easy to read, write and maintain.
12
Example code
13
4. PASCAL
PASCAL is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage
good programming practices using structured programming and data structuring. This language is used for both scientific and business applications.
Its name was assigned in the honor of a French mathematician Blaise Pascal.
ADVANTAGES DISADVANTAGES
14
Example code
15
5. C
C language is a popular high-level language. It was developed by Dennis Ritchie at AT&T Bell Laboratories in 1972. It was written as part
of UNIX operating system. It is also known as middle-level language because it provides the facilities to write application software as well
as system software.
Example code
16
Concept
17
18
2. Object-Oriented Languages
Object-oriented programming (OOP) is a technique in which programs are written on the basis of objects. An object is a collection of data and
functions. Object may represent a person, thing or a place in the real world. In OOP, data and all possible functions on data are grouped together.
Object oriented programs are easier to learn and modify. Python, C++ and Java are three popular object-oriented languages.
Example
A person can be an example of an object. It has some properties or characteristics that describe what it is. Some properties of Person object
can be as follows:
• Name
• Age
• Height
The person object also has some functions that describe what it can do. Some functions of Person object can be as follows:
• Walk
• Talk
• Eat
19
Features of OOP
20
1. PYTHON
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of
significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including
structured, object oriented and functional programming. It is often described as a “batteries included” language due to its comprehensive
standard library. Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and
Example code
print()
apple_stocks[0] = 300
print("Latest apple stocks:")
print(apple_stocks[0])
print()
print(apple_stocks)
apple_stocks[1] = 299.8
print("Lowest apple stocks today:")
print(apple_stocks[1])
print()
apple_stocks[2] = 312.9
print("Highest stocks of apple today:")
print(apple_stocks[2])
21
print("All stocks today")
print(apple_stocks)
22
2. Java
Java was developed at Sun Microsystem in 1995 by a team led by James Gosling. Sun Microsystems was purchased by Oracle in 2010.
Java is an OOP language based on the syntax of C++. It was originally designed in 1991 as Oak for use in embedded chips for electronic
Java can be used to write programs that can run on any platform. It is popular to write Web-based Internet
applications as the World Wide Web required the software to run across all the platforms. It is commonly used to develop applications for
23
Example code
24
3. C++
C++ is an OOP language. It was developed in 1980 at Bell Laboratories. It is an improved version of C language. It provides the facility of
working with objects and classes. It is very powerful language and is used to develop a variety of programs.
25
Example code
26
4. C#
C# (c-sharp) is OOP based on C++. It was developed by Anders Hejlsberg at Microsoft. C# has been accepted as a standard for Web
27
Example code
28
3. Non-Procedural-Languages
Non-procedural languages are also known as fourth generation languages or 4GL. In non-procedural languages, the user only needs to
tell the computer “What to do” not “How to do”. An important advantage of these languages is that they can be used by non-technical user
to perform a specific task. These languages accelerate programming process and reduce the coding errors. 4GL are normally used in
29
1. SQL
SQL stands for Structured Query Language. It is the most popular database query language. SQL was developed by IBM. It is a national
standard by American National Standards Institute (ANSI). SQL works with database programs like MS Access, DB2, Informix, MS SQL Server,
30
Example code
31
2. RPG
RPG stands for Report Program Generator. It was developed in early 1960s by IBM. It is used to generate business reports.
Example code
32
Difference between procedural and non-procedural
33
Advantages of High-level languages
34
Disadvantages of High-level languages
35
Advantages of low-level languages
36
Difference between low-level languages and high-level languages
37
38
39