0% found this document useful (0 votes)
59 views27 pages

Slides 02 Programming Languages - UET CS - Talha Waheed - Classification of PL

Uploaded by

Saleem Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views27 pages

Slides 02 Programming Languages - UET CS - Talha Waheed - Classification of PL

Uploaded by

Saleem Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

CS-445 Programming Languages Slides 2 –

Classification of Programming Languages

By Talha Waheed, UET Lahore


Typical classifications of PL

 Low-level vs. High-level vs. Very High Level


 Language generations
 1st , 2nd , 3rd , 4th, 5th ...
 e.g. machine, assembly, procedural, application,
AI techniques & inference languages, neural nets
 General-purpose vs. special purpose
 C/C++, Scripting Languages,
Robot Programming Language
 Different Language Implementation
 Language Paradigms
2
Communicating with Computers
 Non-Tech Definition of a PL
 way of communicating with computer to tell it what it should do.
 Challenge for half a century
 ENIAC to present

 Approaches to communicating with computers


 Driven by applications and their properties
 Also by computers and their properties
 But a "modern" approach should minimize this
 Still arguments based on "performance"

 But with 500 M operations per second available and doubling every
couple of years
 Performance can no longer be the dominant issue!

3
ENIAC To Present

Ruby on Mobile
Rails Development Machine Learning
4
First Generation of Computers

5
Evolution of Communicating with Computers
• Communicating at all by
 Cables, Binary, ASSEMBLY LANGUAGE
• Communicating math (formulas)
 FORTRAN
• Communicating business math
 To non-mathematicians
 COBOL
• Communicating algorithms
 ALGOL

• Simulation
 SIMULA First Ever Computer Program??

6
1st Generations of Languages -
Machine Languages
 An example code (von Neumann machine, 1946) for the program
Add numbers in locations 10 and 11 and store result in location 12:
00000010101111001010
00000010111111001000
00000011001110101000
 Operations are specified in terms of actual numeric code.
 Operand are specified in terms of their absolute address in memory
or as a register number.
 Everything is encoded as a sequence of 0s and 1s.
 As a result, programming requires deep knowledge of underlying
machine architecture and programs become unintelligible!

7 Programming Languages - Talha Waheed


1st Generations of Languages -
Assembly Languages
 To make programs more intelligible,
 each operation and operand specified using symbolic name
e.g., load, add, store
 Assembler turns assembly code into machine code.
 Can have macros as shorthand for sequences of code
(macro assembler).
 Still Machine dependent, i.e., features depend on
hardware.
 Hard to read and to port to other machines.
 Programming is similar to programming in machine
languages, though somewhat less difficult.
8
Generations of Languages -
High Level Languages
 Today's conventional languages (C, C++, Java, Lisp (List Processor)).
 Higher level constructs such as
 if and while statements, procedures, etc.
 much easier to write and read
 supporting consistency checks which help detect bugs
 preprogrammed libraries (reusability)
 machine independent, though sometimes implementation dependent
 Portable code
 programmer specifies instructions that a language processor
understands and translates or executes.

9
10
11
History of Language Development
 1950s - Exploiting Machine Power
 Machine Language, Assembly Languages, FORTRAN
 1960s - Increasing Expressive Power
 COBOL, Lisp, Algol 60, BASIC, SNOBOL, PL/I, Simula
 1970s - Portability and Reliability
 Pascal, Algol 68, C
 1980s - Managing Complexity
 Modula-2, Ada, Smalltalk, Eiffel, ML
 1990s - Parallelism, Distribution, Objects
 C++, Modula-3, Ada 95, . . . JAVA!!!, XML
 2000s - Web based, AI
 C#, Ruby, Python, R , What Next ???
12 Programming Languages - Talha Waheed
History: mid-1950s to early 1970s (1/2)
Main areas of application
 numerical computation
 1957-FORTRAN
 1958-Algol
 business
 1955-FLOWMATIC (Grace Hopper)
 1959-COBOL
 artificial intelligence
 about 1955-IPL, IPL-2, IPL-V (Newell, Shaw, Simon)
 Fall 1958-Lisp (McCarthy)
 for string processing: COMIT, SNOBOL4
 systems programming
 CPL, BCPL
 1972-C

13 Programming Languages - Talha Waheed


History: mid-1950s to early 1970s (2/2)

 Hardware: main frames running batch processes


 mostly file processing, punched cards
 error recovery and exception handling to reduce need
for reruns
 no timing constraints on programs

14 Programming Languages - Talha Waheed


History: 1970s to 1980s

 Hardware: time sharing main frames


 time sharing --- "an idea whose time has come and
gone"
 interactive computing; keyboard input
 I/O properties of keyboards different from files
 error recovery by interaction with user
 timing constraints (computer response time, user
pauses)

15 Programming Languages - Talha Waheed


History: 1980s to 1990s
 Hardware: PCs, micro-controllers, and embedded
systems
 Time sharing not needed (but reemerges to provide
multiprocessing)
 interactive graphics is important
 micro-controllers and embedded systems operate
without OS or use special real-time OS
 embedded systems must be reliable and correct; need
to operate in real time, recover from errors, ordinarily
never terminate, are often distributed systems
16 Programming Languages - Talha Waheed
History: 1990s to present
 Hardware: the world is one big computer (Internet)
 distributed computing is everywhere on local area networks,
the internet
 reemergence of central computers (servers)
 security becomes even more important than before
 making programs run on multiple platforms becomes an issue

 New applications
 (desktop) publishing: TEX, Postscript
 software agents and other processes, including scripts

17 Programming Languages - Talha Waheed


A Simplified Family Tree of Programming
Languages

18
19
The Evolution of Human

20
21
Factors Influencing Language Design
The language we "speak" influences what we can say
[Whorf]

 Application programmers' perspective


 Make programming as
easy and natural as possible
 Define a user-friendly
"virtual machine“

 Language implementers' perspective


 Make efficient implementation possible
 Define a reasonable mapping to a real machine
22
Factors Influencing Language Design

 Hardware Architecture
 Application Domains
 New uses and users, Changing requirements
 Programming methodologies
 Managing large, complex systems
 Implementation methods
 Improved techniques
 Theoretical studies Hardware

 Assess strengths and weaknesses


 Standardization (formal or de facto)
 Portability & Re-use Applications Programming
Systems
 Strong promoter (usually an organization) Languages
Software
 Easy access to high quality compilers and
tools
23 Theory
Translation

Converting a program written in a HLL into machine language.


Compilation: whole program is translated before execution. (C/C++)
Interpretation: Translate and execute, one statement at a time. (BASIC)

Source Source
Code Code

Compiler Input Interpreter Output

Input Target Output


Code
24
Comparison of the two methods
Compilation Interpretation
 Brings the program down to  Brings the machine up to the
machine level program level.
 Can execute translated program  Must retranslate for every
many times because the entire execution.
translation is produced.
 Program execution is much faster  Program execution is much slower.
because the translator can do
optimization.
 Easier to provide feedback when
 Harder to provide feedback when
debugging because executing the
debugging because executing the
source code.
target code.

25
Pseudocompilation

 A hybrid of compilation and interpretation


Source
Code

Compiler

Intermediate
Code

Input Interpreter Output

26
Pseudo-compilation
 A compiler translates whole program before execution, but only
into intermediate code.

 An interpreter translates and executes intermediate code one


statement at a time.

 The intermediate code can be executed on any machine that has


interpreter for intermediate code.
 more portability and machine independence

 Java initially used this hybrid strategy. (intermediate code: bytecode)


27

You might also like