0% found this document useful (0 votes)
20 views

Programming Language

The document discusses the different generations of programming languages from first to fifth generation. It provides details about each generation including their characteristics, examples and advantages. The first generation includes machine languages. The second generation includes assembly languages. The third generation includes high-level languages like FORTRAN and C. The fourth generation includes very high-level languages to reduce development time and effort.

Uploaded by

Neelam Khurana
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Programming Language

The document discusses the different generations of programming languages from first to fifth generation. It provides details about each generation including their characteristics, examples and advantages. The first generation includes machine languages. The second generation includes assembly languages. The third generation includes high-level languages like FORTRAN and C. The fourth generation includes very high-level languages to reduce development time and effort.

Uploaded by

Neelam Khurana
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Programming Language

Programming Language
• Programming languages have been developed over the year in a
phased manner. Each phase of developed has made the programming
language more user-friendly, easier to use and more powerful. Each
phase of improved made in the development of the programming
languages can be referred to as a generation. The programming
language in terms of their performance reliability and robustness can
be grouped into five different generations,
• First generation languages (1GL)
• Second generation languages (2GL)
• Third generation languages (3GL)
• Fourth generation languages (4GL)
• Fifth generation languages (5GL)
2
Generations of Programming Language
• Programming languages have been developed over the year in a
phased manner. Each phase of developed has made the programming
language more user-friendly, easier to use and more powerful. Each
phase of improved made in the development of the programming
languages can be referred to as a generation. The programming
language in terms of their performance reliability and robustness can
be grouped into five different generations,
• First generation languages (1GL)
• Second generation languages (2GL)
• Third generation languages (3GL)
• Fourth generation languages (4GL)
• Fifth generation languages (5GL)
3
4
Generation of Computer Languages
1GL: machine codes
2GL: symbolic assemblers
3GL: (machine-independent) imperative languages (FORTRAN, Pascal,
C ...)
4GL: domain specific application generators
5GL: AI languages …

Each generation is at a higher level of abstraction

5
A Brief Chronology
Early 1950s “order codes” (primitive assemblers)
1957 FORTRAN the first high-level programming language
1958 ALGOL the first modern, imperative language
1960 LISP, COBOL Interactive programming; business programming
1962 APL, SIMULA the birth of OOP (SIMULA)
1964 BASIC, PL/I
1966 ISWIM first modern functional language (a proposal)
1970 Prolog logic programming is born
1972 C the systems programming language
1975 Pascal, Scheme two teaching languages
1978 CSP Concurrency matures
1978 FP Backus’ proposal
1983 Smalltalk-80, Ada OOP is reinvented
1984 Standard ML FP becomes mainstream (?)
1986 C++, Eiffel OOP is reinvented (again)
1988 CLOS, Oberon, Mathematica
1990 Haskell FP is reinvented
1990s Perl, Python, Ruby, JavaScript Scripting languages become mainstream
1995 Java OOP is reinvented for the internet
2000 C#
6
1. First Generation Language (Machine language)
The first generation programming language is also called low-level
programming language because they were used to program the
computer system at a very low level of abstraction. i.e. at the machine
level. The machine language also referred to as the native language of the
computer system is the first generation programming language. In the
machine language, a programmer only deals with a binary number.
Advantages of first generation language
• They are translation free and can be directly executed by the
computers.
• The programs written in these languages are executed very speedily
and efficiently by the CPU of the computer system.
• The programs written in these languages utilize the memory in an
efficient manner because it is possible to keep track of each bit of data.
7
2. Second Generation language (Assembly
Language)
The second generation programming language also belongs to the
category of low-level- programming language. The second generation
language comprises assembly languages that use the concept of
mnemonics for the writing program. In the assembly language,
symbolic names are used to represent the opcode and the operand
part of the instruction.
Advantages of second generation language
• It is easy to develop understand and modify the program developed in
these languages are compared to those developed in the first
generation programming language.
• The programs written in these languages are less prone to errors and
therefore can be maintained with a great case.

8
3. Third Generation languages (High-Level
Languages)
The third generation programming languages were designed to overcome the various
limitations of the first and second generation programming languages. The languages of
the third and later generation are considered as a high-level language because they enable
the programmer to concentrate only on the logic of the programs without considering the
internal architecture of the computer system.
• Most high level languages are considered to be procedure-oriented, or Procedural
languages, because the program instructions comprise lists of steps, procedures, that tell
the computer not only what to do but how to do it. High-level language statements
generate, when translated, a comparatively greater number of assembly language
instructions and even more machine language instructions. The programmer spends less
time developing software with a high level language than with assembly or machine
language because fewer instructions have to be created.
• A language translator is required to convert a high-level language program into machine
language. Two types of language translators are used with high level languages:
compilers and interpreters.

9
3. Third Generation languages (HLL) …contd.
Advantages of third generation programming language
• It is easy to develop, learn and understand the program.
• As the program written in these languages are less prone to errors they are easy to
maintain.
• The program written in these languages can be developed in very less time as compared
to the first and second generation language.
• Examples: FORTRAN, ALGOL, COBOL, C++, C

10
4. Fourth generation language (Very High-level Languages)
The languages of this generation were considered as very high-level programming
languages required a lot of time and effort that affected the productivity of a programmer.
The fourth generation programming languages were designed and developed to reduce the
time, cost and effort needed to develop different types of software applications.
Five basic types of language tools fall into the fourth generation language category.
• Query languages
• Report generators.
• Applications generators.
• Decision support systems and financial planning languages.
• Some microcomputer application software.

11
4. Fourth generation language (Very High-level Languages)
….contd.
• Query languages allow the user to ask questions about, or retrieve information from database
files by forming requests in normal human language statements (such as English). The difference
between the definitions for query language and for database management systems software is so
slight that most people consider the definitions to be the same. Query languages do have a
specific grammar vocabulary, and syntax that must be mastered, but this is usually a simple task
for both users and programmers.
• Report generators are similar to query languages in that they allow users to ask questions from a
database and retrieve information from it for a report {the output); however, in case of a report
generator, the user is unable to alter the contents of the database file. And with a report
generator, the user has much greater control over what the output will look like. The user of a
report generator can specify that the software automatically determine how the output should
look or can create his or her own customized output reports using special report generator
command instructions.
• Application generators allow the user to reduce the time it takes to design an entire software
application that accepts input, ensures data has been input accurately, performs complex
calculations and processing logic, and outputs information in the form of reports. The user must
key into computer-useable form the specification for what the program is supposed to do. The
resulting file is input to the applications generator, which determine how to perform the tasks and
which then produces the necessary instructions for the software program.
12
4. Fourth generation language (Very High-level Languages)
….contd.
• Decision support systems and financial planning languages combine special interactive computer programs
and some special hardware to allow high level managers to bring data and information together from
different sources and manipulate it in new ways.
• Some microcomputer applications software can also be used to create specialized applications - in other
words, to create new software. Microcomputer software packages that fall into this category include many
spreadsheet programs (such as Lotus 1-2-3), database managers (Such as dBase IV), and integrated packages
(such as Symphony).
Advantages of fourth generation languages
• These programming languages allow the efficient use of data by implementing the various database.
• They require less time, cost and effort to develop different types of software applications.
• The program developed in these languages are highly portable as compared to the programs developed in
the languages of other generation.
• Minimizing user effort to obtain information from computer.
• Decreasing the skill level required of users so that they can concentrate on the application rather than the
intricacies of coding, and thus solve their own problems without the aid of a professional programmer.
• Minimizing maintenance by reducing errors and making programs that are easy to change.
• Depending on the language, the sophistication of fourth generation languages varies widely. These
languages are usually used in conjunction with a database and its data dictionary.
• Examples: SOL, CSS, coldfusion
13
5. Fifth generation language (Artificial Intelligence
Language)
The programming languages of this generation mainly focus on
constraint programming. The major fields in which the fifth generation
programming language are employed are Artificial Intelligence and
Artificial Neural Networks
Advantages of fifth generation languages
• These languages can be used to query the database in a fast and
efficient manner.
• In this generation of language, the user can communicate with the
computer system in a simple and an easy manner.
• Examples: mercury, prolog, OPS5

14
“Hello World” in FORTRAN
PROGRAM HELLO
DO 10, I=1,10
PRINT *,'Hello World'
10 CONTINUE
STOP
END

15
“Hello World” in BEALGOL

BEGIN
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:11];
REPLACE E BY "HELLO WORLD!";
WHILE TRUE DO
BEGIN
WRITE (F, *, E);
END;
END.

16
“Hello World” in COBOL
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300 DATE-WRITTEN. 02/05/96 21:04.
000400* AUTHOR BRIAN COLLINS
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
001000 DATA DIVISION.
001100 FILE SECTION.
100000 PROCEDURE DIVISION.
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "HELLO, WORLD." LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.

17
“Hello World” in PL/1

HELLO: PROCEDURE OPTIONS (MAIN);

/* A PROGRAM TO OUTPUT HELLO WORLD */


FLAG = 0;

LOOP: DO WHILE (FLAG = 0);


PUT SKIP DATA('HELLO WORLD!');
END LOOP;

END HELLO;

18
“Hello World” in Functional Languages

SML print("hello world!\n");

Haskell hello() = print "Hello World"

19
“Hello World” in Prolog

hello :- printstring("HELLO WORLD!!!!").

printstring([]).
printstring([H|T]) :- put(H), printstring(T).

20
“Hello World” in SQL

CREATE TABLE HELLO (HELLO CHAR(12))


UPDATE HELLO
SET HELLO = 'HELLO WORLD!'
SELECT * FROM HELLO

21
Main features of programming languages
The popularity of a programming language depends on the features and utilities it provides
to programmers. The features that a programming language must have to stand out are the
following:
• Simplicity: the language must offer clear and simple concepts that facilitate its learning
and application, in a way that is simple to understand and maintain. Simplicity does not
mean that it can be subtracted from the optimal power of functioning.
• Naturalness: this means that its application in the area for which it was designed must be
done naturally, providing operators, structures and syntax for operators to work
efficiently.
• Abstraction: it is the ability to define and use complicated structures or operations while
ignoring some details, which influences writing ability.
• Efficiency: Programming languages must be translated and executed efficiently so as not
to take up too much memory space or require too much time.
• Structuring: the language allows programmers to write their codes according to
structured programming concepts, to avoid creating errors.

22
Main features of programming languages …..contd.
• Compactness: with this characteristic, it is possible to express operations concisely,
without having to write too many details.
• Locality: refers to the codes concentrating on the part of the program with which you are
working at a given time.
• Portability: A program should be supported by many different computers. The program
should compile and run smoothly on different platforms. So, portability is measured by
how a software application can be transferred from one computer environment to
another without failure. A program is said to be more portable, if it is easily adopted in
different computer systems.
• Maintainability: It is the process of fixing program errors and improving the program. If a
program is easy to read and understand, then its maintenance will be easier. It should
also prevent unwanted works, so that the maintenance cost in future will be low. It
should also have quality to easily meet new requirements.
• Reliable: The user's actual needs will change from time-to-time, so program is said to be
reliable if it works smoothly in every version. It is measured as high reliable if it gives
same performance in all simple to complex conditions.
23
Main features of programming languages …..contd.
• Machine Independence: Program should be machine independent. Program written on
one system should be able to execute on any other without any changes. It is not system
specific and provide more flexibility.
• Cost Effectiveness: Cost Effectiveness is the key to measure the program quality. Cost
must be measured over the life of the program and must include both cost and human
cost of producing these programs.
• Flexible: Program should be written in such a manner that it allows to add new features
without changing the existing module. It should be always ready to meet new
requirements. A high flexible software is always ready for a new world of possibilities.
• Orthogonality: It is one of the most important feature of a programming language. It
means “Changing A doesn’t change B”. E.g. In a radio where changing station doesn’t
change the volume and vice versa.
• Reusability: Code written may be reused in another programs as well.
• Readability: A good high-level language will allow programs to be written in some ways
that resemble a quite-English description of the underlying algorithms. If care is taken,
the coding may be done in a way that is essentially self-documenting.
24
Main features of programming languages …..contd.
• Generality: Most high-level languages allow the writing of a wide variety of programs,
thus relieving the programmer of the need to become expert in many diverse languages.
• Brevity: Language should have the ability to implement the algorithm with less amount
of code. Programs expressed in high-level languages are often considerably shorter than
their low-level equivalents.
• Error checking: Being human, a programmer is likely to make many mistakes in the
development of a computer program. Many high-level languages enforce a great deal of
error checking both at compile-time and at run-time.
• Familiar notation: A language should have familiar notation, so it can be understood by
most of the programmers.
• Quick translation: It should admit quick translation.
• Efficiency: It should permit the generation of efficient object code.
• Modularity: It is desirable that programs can be developed in the language as a
collection of separately compiled modules, with appropriate mechanisms for ensuring
self-consistency between these modules.
25

You might also like