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

Computer Languages

This document discusses different types of programming languages. It begins by defining a programming language as a set of rules that tells a computer what operations to perform. It then describes the evolution of programming languages from low-level machine languages to high-level languages that more closely resemble human language. The document categorizes programming languages into five generations - from first generation machine languages to fourth generation languages that require fewer instructions to accomplish tasks. It provides examples of languages from each generation such as C++, Java, and Prolog.

Uploaded by

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

Computer Languages

This document discusses different types of programming languages. It begins by defining a programming language as a set of rules that tells a computer what operations to perform. It then describes the evolution of programming languages from low-level machine languages to high-level languages that more closely resemble human language. The document categorizes programming languages into five generations - from first generation machine languages to fourth generation languages that require fewer instructions to accomplish tasks. It provides examples of languages from each generation such as C++, Java, and Prolog.

Uploaded by

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

Computer Languages

Programming Language Concepts


 What is a programming language?
 Why are there so many programming languages?
 What are the types of programming languages?
 Does the world need new languages?
What is a Programming Languages

 A programming language is a set of rules that


provides a way of telling a computer what
operations to perform.
 A programming language is a set of rules for

communicating an algorithm
 It provides a linguistic framework for describing

computations
What is a Programming Language

 English is a natural language. It has words, symbols


and grammatical rules.
 A programming language also has words, symbols

and rules of grammar.


 The grammatical rules are called syntax.
 Each programming language has a different set of

syntax rules.
Why Are There So Many Programming
Languages ………….???
 Why does some people speak French?
 Programming languages have evolved over time as

better ways have been developed to design them.


◦ First programming languages were developed in the 1950s
◦ Since then thousands of languages have been developed
 Different programming languages are designed for
different types of programs.
Algorithm
 Abu Ja’far Muhammad ibn Musa
al-Khorezmi (“from Khorezm”)
◦ Lived in Baghdad around 780 – 850 AD
◦ Chief mathematician in Khalif Al
Mamun’s “House of Wisdom”
◦ Author of “A Compact Introduction To
Calculation Using Rules Of Completion
And Reduction”

Removing negative units from the


equation by adding the same quantity on
the other side (“al-gabr” in Arabic)
sli
de
6
C
 Bell Labs 1972 (Dennis Ritchie)
 Development closely related to UNIX

◦ 1983 Turing Award to Thompson and


Ritchie
 Added weak typing to B
◦ int, char, their pointer types
◦ Typed arrays = typed pointers
 int a[10]; … x = a[i]; means
x = *(&a[0]+i*sizeof(int))
 Compiles to native code

sli
de
7
Types in C
 Main difference between B and C
 Syntax of type rules influenced by Algol 68

◦ int i, *pi, **ppi;


◦ int f(), *f(), **f(), *(*pf)(), (*pf)(int);
◦ int *api[10], (*pai)[10];
 Also structs and unions What do these
declarations mean?

sli
de
8
Evolution of C
 1973-1980: new features; compiler ported
◦ unsigned, long, union, enums
 1978: K&R C book published
 1989: ANSI C standardization

◦ Function prototypes as in C++


 1999: ISO 9899:1999 also known as “C99”
◦ Inline functions, C++-like decls, bools, variable
arrays
 Concurrent C, Objective C, C*, C++, C#
 “Portable assembly language”

◦ Early C++, Modula-3, Eiffel source-translated to C sli


de
9
C++
 Bell Labs 1979 (Bjarne Stroustrup)
◦ “C with Classes” (C++ since 1983)
 Influenced by Simula
 Originally translated into C using

Cfront, then native compilers


◦ GNU g++
 Several PL concepts
◦ Multiple inheritance
◦ Templates / generics
◦ Exception handling
sli
de
10
What Are the Types of Programming
Languages
 First Generation Languages
 Second Generation Languages
 Third Generation Languages
 Fourth Generation Languages
 Fifth Generation Languages
Definition Of Computer
Languages
• Computer languages are the languages by
which a user command the computer to work
on the algorithm which a user has written to
hit an output.
• Two types of computer languages:-
• (1)Low level languages
• (2)High level languages
Low Level Language
A low Level language is a programming language
that provides little or no abstraction form a
computer’s instruction set architecture. A lower
level language is used in two generations of
computers.

1. First Generation.
2. Second Generation.
First Generation Language (1GL)
• Represent the very early, primitive Computer languages
that consisted entirely of 1’s and 0’s- The actual language
that the computer understands (machine language)
• Machine language is machine
dependent as it is the
only language the computer
can understand.
– Very efficient code but very
difficult to write.
Second Generation Language (2GL)

Represent a step up from the 1GL. Allow for


the use of symbolic names instead of just
numbers. Second Generation languages are
known as assembly languages. Code written in
an assembly language is converted into machine
language (1GL)
Each assembly language instruction is
translated into one machine language
instruction.
Very efficient code and easier to write.
High Level Languages
• High Level programming languages allow the
specification of a problem solution in terms closer to
those used by human beings. These languages were
designed to make programming far easier, less error-
prone and to remove the programmer from having to
know the details of internal structure of a particular
computer. This language is used in third generation.
Third Generation Language (3GL)
• With the languages introduced by 3GL of computer
programming , words and commands were being used. These
languages therefore, had syntax that was much easier to
understand. Third Generation Languages are known as
“High Level Languages”.
Programs written in source code which must be translated into
machine language programs called object code.
The translation of source code to object code is accomplished
by a machine language system program called a compiler.
TYPES
• C++

• Visual Basic

• Java

• Java script
Fourth Generation Languages
 A high level language (4GL) that requires fewer
instructions to accomplish a task than a third generation
language.
 It tells that what to do and not concern how to do.
 Used with databases
◦ Query languages
◦ Report generators
◦ Forms designers
◦ Application generators
Fifth Generation Languages
• Declarative languages
• Functional(?): Lisp, Scheme, SML
– Also called applicative
– Everything is a function
• Logic: Prolog
– Based on mathematical logic
– Rule- or Constraint-based
C++
• C++ is statically typed, free-form, multi paradigm
compiled, general purpose programming language. It is
regarded as a “Middle Level Language” as it comprises a
combination of both high and low level language features.
• Language Features:-
1. Operators and operator overloading.
2. Templates.
3. Objects.
4. Polymorphism.

You might also like