SlideShare uma empresa Scribd logo
1 de 37
Programming
Languages
Dr. Kamal Gulati
What is a Programming Language?
1.2
> A formal language for describing computation?
> A “user interface” to a computer?
> Syntax + semantics?
> Compiler, or interpreter, or translator?
> A tool to support a programming paradigm?
A programming language is a notational
system for describing computation in a
machine-readable and human-readable form.
— Louden
What is a Programming Language? (II)
1.3
A programming language is a tool for
developing executable models for a
class of problem domains.
The thesis of this course:
Themes Addressed in this Course
1.4
Paradigms
How do different language paradigms
support problem-solving?
Semantics
How can we understand the semantics
of programming languages?
Foundations
What are the foundations of
programming languages?
1.5
Generations of Programming 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
1.6
How do Programming Languages Differ?
Common Constructs:
> basic data types (numbers, etc.); variables; expressions;
statements; keywords; control constructs; procedures;
comments; errors ...
Uncommon Constructs:
> type declarations; special types (strings, arrays,
matrices, ...); sequential execution; concurrency
constructs; packages/modules; objects; general
functions; generics; modifiable state; ...
1.7
Programming Paradigms
A programming language is a problem-solving tool.
Imperative style:
program = algorithms + data
good for decomposition
Functional style:
program = functions o functions
good for reasoning
Logic programming style:
program = facts + rules
good for searching
Object-oriented style:
program = objects + messages
good for modeling(!)
Other styles and paradigms: blackboard, pipes and filters,
constraints, lists, ...
1.8
Compilers and Interpreters
Compilers and interpreters have similar
front-ends, but have different back-ends.
1.9
Roadmap
> Course Schedule
> Programming Paradigms
> A Quick Tour of Programming Language History
1.10
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#
1.11
Fortran
History
> John Backus (1953) sought to write programs in conventional
mathematical notation, and generate code comparable to good
assembly programs.
> No language design effort (made it up as they went along)
> Most effort spent on code generation and optimization
> FORTRAN I released April 1957; working by April 1958
> The current standard is FORTRAN 2003
(FORTRAN 2008 is work in progress)
1.12
Fortran …
Innovations
> Symbolic notation for subroutines and functions
> Assignments to variables of complex expressions
> DO loops
> Comments
> Input/output formats
> Machine-independence
Successes
> Easy to learn; high level
> Promoted by IBM; addressed large user base
> (scientific computing)
1.13
“Hello World” in FORTRAN
All examples from the ACM "Hello World" project:
www2.latech.edu/~acm/HelloWorld.shtml
PROGRAM HELLO
DO 10, I=1,10
PRINT *,'Hello World'
10 CONTINUE
STOP
END
1.14
ALGOL 60
History
> Committee of PL experts formed in 1955 to design universal, machine-
independent, algorithmic language
> First version (ALGOL 58) never implemented; criticisms led to ALGOL 60
Innovations
> BNF (Backus-Naur Form) introduced to define syntax (led to syntax-
directed compilers)
> First block-structured language; variables with local scope
> Structured control statements
> Recursive procedures
> Variable size arrays
Successes
> Highly influenced design of other PLs but never displaced FORTRAN
1.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.
1.16
COBOL
History
> Designed by committee of US computer manufacturers
> Targeted business applications
> Intended to be readable by managers (!)
Innovations
> Separate descriptions of environment, data, and processes
Successes
> Adopted as de facto standard by US DOD
> Stable standard for 25 years
> Still the most widely used PL for business applications (!)
1.17
“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.
1.18
PL/1
History
> Designed by committee of IBM and users (early 1960s)
> Intended as (large) general-purpose language for broad classes of
applications
Innovations
> Support for concurrency (but not synchronization)
> Exception-handling on conditions
Successes
> Achieved both run-time efficiency and flexibility (at expense of
complexity)
> First “complete” general purpose language
1.19
“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;
1.20
Functional Languages
ISWIM (If you See What I Mean)
> Peter Landin (1966) — paper proposal
FP
> John Backus (1978) — Turing award lecture
ML
> Edinburgh
> initially designed as meta-language for theorem proving
> Hindley-Milner type inference
> “non-pure” functional language (with assignments/side effects)
Miranda, Haskell
> “pure” functional languages with “lazy evaluation”
1.21
“Hello World” in Functional Languages
SML
Haskell
print("hello world!n");
hello() = print "Hello World"
1.22
Prolog
History
> Originated at U. Marseilles (early 1970s), and compilers developed
at Marseilles and Edinburgh (mid to late 1970s)
Innovations
> Theorem proving paradigm
> Programs as sets of clauses: facts, rules and questions
> Computation by “unification”
Successes
> Prototypical logic programming language
> Used in Japanese Fifth Generation Initiative
1.23
“Hello World” in Prolog
hello :- printstring("HELLO WORLD!!!!").
printstring([]).
printstring([H|T]) :- put(H), printstring(T).
1.24
Object-Oriented Languages
History
> Simula was developed by Nygaard and Dahl (early 1960s) in Oslo
as a language for simulation programming, by adding classes and
inheritance to ALGOL 60
> Smalltalk was developed by Xerox PARC (early 1970s) to drive
graphic workstations
Begin
while 1 = 1 do begin
outtext ("Hello World!");
outimage;
end;
End;
Transcript show:'Hello World';cr
1.25
Object-Oriented Languages
Innovations
> Encapsulation of data and operations (contrast ADTs)
> Inheritance to share behaviour and interfaces
Successes
> Smalltalk project pioneered OO user interfaces
> Large commercial impact since mid 1980s
> Countless new languages: C++, Objective C, Eiffel,
Beta, Oberon, Self, Perl 5, Python, Java, Ada 95 ...
1.26
Interactive Languages
Made possible by advent of time-sharing systems (early 1960s through
mid 1970s).
BASIC
> Developed at Dartmouth College in mid 1960s
> Minimal; easy to learn
> Incorporated basic O/S commands (NEW, LIST, DELETE, RUN,
SAVE)
...
10 print "Hello World!"
20 goto 10
1.27
Interactive Languages ...
APL
> Developed by Ken Iverson for concise description of numerical
algorithms
> Large, non-standard alphabet (52 characters in addition to
alphanumerics)
> Primitive objects are arrays (lists, tables or matrices)
> Operator-driven (power comes from composing array operators)
> No operator precedence (statements parsed right to left)
'HELLO WORLD'
1.28
Special-Purpose Languages
SNOBOL
> First successful string manipulation language
> Influenced design of text editors more than other PLs
> String operations: pattern-matching and substitution
> Arrays and associative arrays (tables)
> Variable-length strings
...
OUTPUT = 'Hello World!'
END
1.29
Symbolic Languages ...
Lisp
> Performs computations on symbolic expressions
> Symbolic expressions are represented as lists
> Small set of constructor/selector operations to create and
manipulate lists
> Recursive rather than iterative control
> No distinction between data and programs
> First PL to implement storage management by garbage collection
> Affinity with lambda calculus
(DEFUN HELLO-WORLD ()
(PRINT (LIST 'HELLO 'WORLD)))
1.30
4GLs
“Problem-oriented” languages
> PLs for “non-programmers”
> Very High Level (VHL) languages for specific problem domains
Classes of 4GLs (no clear boundaries)
> Report Program Generator (RPG)
> Application generators
> Query languages
> Decision-support languages
Successes
> Highly popular, but generally ad hoc
1.31
“Hello World” in RPG
H
FSCREEN O F 80 80 CRT
C EXCPT
OSCREEN E 1
O 12 'HELLO WORLD!'
1.32
“Hello World” in SQL
CREATE TABLE HELLO (HELLO CHAR(12))
UPDATE HELLO
SET HELLO = 'HELLO WORLD!'
SELECT * FROM HELLO
1.33
Scripting Languages
History
Countless “shell languages” and “command languages” for operating
systems and configurable applications
echo "Hello, World!"
on OpenStack
show message box
put "Hello World!" into message box
end OpenStack
puts "Hello World "
print "Hello, World!n";
> Unix shell (ca. 1971) developed as
user shell and scripting tool
> HyperTalk (1987) was developed at
Apple to script HyperCard stacks
> TCL (1990) developed as embedding
language and scripting language for
X windows applications (via Tk)
> Perl (~1990) became de facto web
scripting language
1.34
Scripting Languages ...
Innovations
> Pipes and filters (Unix shell)
> Generalized embedding/command languages (TCL)
Successes
> Unix Shell, awk, emacs, HyperTalk, AppleTalk, TCL, Python, Perl,
VisualBasic ...
The future?
> Dynamic languages
— very active
> Domain-specific languages
— very active
> Visual languages
— many developments, but still immature
> Modeling languages
— emerging from UML and MDE …
© Oscar Nierstrasz
Safety Patterns
35
1.36
What you should know!
 What, exactly, is a programming language?
 How do compilers and interpreters differ?
 Why was FORTRAN developed?
 What were the main achievements of ALGOL 60?
 Why do we call C a “Third Generation Language”?
 What is a “Fourth Generation Language”?
1.37
Can you answer these questions?
 Why are there so many programming languages?
 Why are FORTRAN and COBOL still important programming
languages?
 Which language should you use to implement a spelling checker?
 A filter to translate upper-to-lower case?
 A theorem prover?
 An address database?
 An expert system?
 A game server for initiating chess games on the internet?
 A user interface for a network chess client?

Mais conteúdo relacionado

Mais procurados

Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer ProgrammingHussain Buksh
 
Generations of programming language
Generations of programming languageGenerations of programming language
Generations of programming languageJAIDEVPAUL
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
 
Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1lakshmi kumari neelapu
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 
Programming languages
Programming languagesProgramming languages
Programming languagesvito_carleone
 
Program & language generation
Program & language generationProgram & language generation
Program & language generationBuxoo Abdullah
 
Programming languages
Programming languagesProgramming languages
Programming languagesSimon Mui
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languageskitturashmikittu
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 
What is programming what are its benefits
What is programming  what are its benefits What is programming  what are its benefits
What is programming what are its benefits Vijay Singh Khatri
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_languageWay2itech
 
Why programming is important
Why programming is importantWhy programming is important
Why programming is importantAman Kumar
 

Mais procurados (20)

Introduction to programming languages
Introduction to programming languagesIntroduction to programming languages
Introduction to programming languages
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer Programming
 
Generations of programming language
Generations of programming languageGenerations of programming language
Generations of programming language
 
Computer Language
Computer LanguageComputer Language
Computer Language
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Program & language generation
Program & language generationProgram & language generation
Program & language generation
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
 
Evolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/SystemEvolution and History of Programming Languages - Software/Hardware/System
Evolution and History of Programming Languages - Software/Hardware/System
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languages
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
What is programming what are its benefits
What is programming  what are its benefits What is programming  what are its benefits
What is programming what are its benefits
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_language
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
Why programming is important
Why programming is importantWhy programming is important
Why programming is important
 

Semelhante a Programming Languages

Programing paradigm & implementation
Programing paradigm & implementationPrograming paradigm & implementation
Programing paradigm & implementationBilal Maqbool ツ
 
Grade 10 introduction and history of programming
Grade 10   introduction and history of programmingGrade 10   introduction and history of programming
Grade 10 introduction and history of programmingRafael Balderosa
 
History of Computer Programming Languages.pptx
History of Computer Programming Languages.pptxHistory of Computer Programming Languages.pptx
History of Computer Programming Languages.pptxAliAbbas906043
 
02-chapter-1.ppt
02-chapter-1.ppt02-chapter-1.ppt
02-chapter-1.pptJoel Manio
 
A History of Computer Programming Languages.pdf
A History of Computer Programming Languages.pdfA History of Computer Programming Languages.pdf
A History of Computer Programming Languages.pdfSohaib Roomi
 
2 evolution of the major programming languages
2 evolution of the major programming languages2 evolution of the major programming languages
2 evolution of the major programming languagesjigeno
 
Programming Language Evolution
Programming Language EvolutionProgramming Language Evolution
Programming Language EvolutionKushan Dananjaya
 
The History of Programming.pptx
The History of Programming.pptxThe History of Programming.pptx
The History of Programming.pptxsheillakontor
 
Lesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptxLesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptxDysRobles
 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .NetAmr Shawky
 
all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programminghamza239523
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2REHAN IJAZ
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilersAftab Ahmad
 

Semelhante a Programming Languages (20)

01 intro
01 intro 01 intro
01 intro
 
Programing paradigm & implementation
Programing paradigm & implementationPrograming paradigm & implementation
Programing paradigm & implementation
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Grade 10 introduction and history of programming
Grade 10   introduction and history of programmingGrade 10   introduction and history of programming
Grade 10 introduction and history of programming
 
History of Computer Programming Languages.pptx
History of Computer Programming Languages.pptxHistory of Computer Programming Languages.pptx
History of Computer Programming Languages.pptx
 
Ayushi
AyushiAyushi
Ayushi
 
02-chapter-1.ppt
02-chapter-1.ppt02-chapter-1.ppt
02-chapter-1.ppt
 
A History of Computer Programming Languages.pdf
A History of Computer Programming Languages.pdfA History of Computer Programming Languages.pdf
A History of Computer Programming Languages.pdf
 
2 evolution of the major programming languages
2 evolution of the major programming languages2 evolution of the major programming languages
2 evolution of the major programming languages
 
Programming Language Evolution
Programming Language EvolutionProgramming Language Evolution
Programming Language Evolution
 
The History of Programming.pptx
The History of Programming.pptxThe History of Programming.pptx
The History of Programming.pptx
 
Itc chapter # 8
Itc   chapter # 8Itc   chapter # 8
Itc chapter # 8
 
Lesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptxLesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptx
 
Assignment on basic programming language
Assignment on  basic programming languageAssignment on  basic programming language
Assignment on basic programming language
 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .Net
 
all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programming
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
 
Computer languages 11
Computer languages 11Computer languages 11
Computer languages 11
 

Mais de Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU

Mais de Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU (20)

All About DBMS - Interview Question and Answers
All About DBMS - Interview Question and AnswersAll About DBMS - Interview Question and Answers
All About DBMS - Interview Question and Answers
 
Concept of Governance - Management of Operational Risk for IT Officers/Execut...
Concept of Governance - Management of Operational Risk for IT Officers/Execut...Concept of Governance - Management of Operational Risk for IT Officers/Execut...
Concept of Governance - Management of Operational Risk for IT Officers/Execut...
 
Emerging Technologies in IT
Emerging Technologies in ITEmerging Technologies in IT
Emerging Technologies in IT
 
Introduction to DBMS - Notes in Layman...
Introduction to DBMS - Notes in Layman...Introduction to DBMS - Notes in Layman...
Introduction to DBMS - Notes in Layman...
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
CASE (Computer Aided Software Design)
CASE (Computer Aided Software Design)CASE (Computer Aided Software Design)
CASE (Computer Aided Software Design)
 
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
SOFTWARE RELIABILITY AND QUALITY ASSURANCESOFTWARE RELIABILITY AND QUALITY ASSURANCE
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
 
Software Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC ModelSoftware Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC Model
 
Software Testing - SDLC Model
Software Testing - SDLC ModelSoftware Testing - SDLC Model
Software Testing - SDLC Model
 
Coding - SDLC Model
Coding - SDLC ModelCoding - SDLC Model
Coding - SDLC Model
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
Software Design - SDLC Model
 
Models of SDLC (Contd..) & Feasibility Study
Models of SDLC (Contd..)  & Feasibility StudyModels of SDLC (Contd..)  & Feasibility Study
Models of SDLC (Contd..) & Feasibility Study
 
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKETCLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
 
Application Software
Application SoftwareApplication Software
Application Software
 
Application Software – Horizontal & Vertical Software
Application Software – Horizontal & Vertical SoftwareApplication Software – Horizontal & Vertical Software
Application Software – Horizontal & Vertical Software
 
Software: Systems and Application Software
Software:  Systems and Application SoftwareSoftware:  Systems and Application Software
Software: Systems and Application Software
 
Number Codes and Registers
Number Codes and RegistersNumber Codes and Registers
Number Codes and Registers
 
PROGRAMMING AND LANGUAGES
PROGRAMMING AND LANGUAGES  PROGRAMMING AND LANGUAGES
PROGRAMMING AND LANGUAGES
 

Último

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 

Último (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 

Programming Languages

  • 2. What is a Programming Language? 1.2 > A formal language for describing computation? > A “user interface” to a computer? > Syntax + semantics? > Compiler, or interpreter, or translator? > A tool to support a programming paradigm? A programming language is a notational system for describing computation in a machine-readable and human-readable form. — Louden
  • 3. What is a Programming Language? (II) 1.3 A programming language is a tool for developing executable models for a class of problem domains. The thesis of this course:
  • 4. Themes Addressed in this Course 1.4 Paradigms How do different language paradigms support problem-solving? Semantics How can we understand the semantics of programming languages? Foundations What are the foundations of programming languages?
  • 5. 1.5 Generations of Programming 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
  • 6. 1.6 How do Programming Languages Differ? Common Constructs: > basic data types (numbers, etc.); variables; expressions; statements; keywords; control constructs; procedures; comments; errors ... Uncommon Constructs: > type declarations; special types (strings, arrays, matrices, ...); sequential execution; concurrency constructs; packages/modules; objects; general functions; generics; modifiable state; ...
  • 7. 1.7 Programming Paradigms A programming language is a problem-solving tool. Imperative style: program = algorithms + data good for decomposition Functional style: program = functions o functions good for reasoning Logic programming style: program = facts + rules good for searching Object-oriented style: program = objects + messages good for modeling(!) Other styles and paradigms: blackboard, pipes and filters, constraints, lists, ...
  • 8. 1.8 Compilers and Interpreters Compilers and interpreters have similar front-ends, but have different back-ends.
  • 9. 1.9 Roadmap > Course Schedule > Programming Paradigms > A Quick Tour of Programming Language History
  • 10. 1.10 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#
  • 11. 1.11 Fortran History > John Backus (1953) sought to write programs in conventional mathematical notation, and generate code comparable to good assembly programs. > No language design effort (made it up as they went along) > Most effort spent on code generation and optimization > FORTRAN I released April 1957; working by April 1958 > The current standard is FORTRAN 2003 (FORTRAN 2008 is work in progress)
  • 12. 1.12 Fortran … Innovations > Symbolic notation for subroutines and functions > Assignments to variables of complex expressions > DO loops > Comments > Input/output formats > Machine-independence Successes > Easy to learn; high level > Promoted by IBM; addressed large user base > (scientific computing)
  • 13. 1.13 “Hello World” in FORTRAN All examples from the ACM "Hello World" project: www2.latech.edu/~acm/HelloWorld.shtml PROGRAM HELLO DO 10, I=1,10 PRINT *,'Hello World' 10 CONTINUE STOP END
  • 14. 1.14 ALGOL 60 History > Committee of PL experts formed in 1955 to design universal, machine- independent, algorithmic language > First version (ALGOL 58) never implemented; criticisms led to ALGOL 60 Innovations > BNF (Backus-Naur Form) introduced to define syntax (led to syntax- directed compilers) > First block-structured language; variables with local scope > Structured control statements > Recursive procedures > Variable size arrays Successes > Highly influenced design of other PLs but never displaced FORTRAN
  • 15. 1.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. 1.16 COBOL History > Designed by committee of US computer manufacturers > Targeted business applications > Intended to be readable by managers (!) Innovations > Separate descriptions of environment, data, and processes Successes > Adopted as de facto standard by US DOD > Stable standard for 25 years > Still the most widely used PL for business applications (!)
  • 17. 1.17 “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.
  • 18. 1.18 PL/1 History > Designed by committee of IBM and users (early 1960s) > Intended as (large) general-purpose language for broad classes of applications Innovations > Support for concurrency (but not synchronization) > Exception-handling on conditions Successes > Achieved both run-time efficiency and flexibility (at expense of complexity) > First “complete” general purpose language
  • 19. 1.19 “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;
  • 20. 1.20 Functional Languages ISWIM (If you See What I Mean) > Peter Landin (1966) — paper proposal FP > John Backus (1978) — Turing award lecture ML > Edinburgh > initially designed as meta-language for theorem proving > Hindley-Milner type inference > “non-pure” functional language (with assignments/side effects) Miranda, Haskell > “pure” functional languages with “lazy evaluation”
  • 21. 1.21 “Hello World” in Functional Languages SML Haskell print("hello world!n"); hello() = print "Hello World"
  • 22. 1.22 Prolog History > Originated at U. Marseilles (early 1970s), and compilers developed at Marseilles and Edinburgh (mid to late 1970s) Innovations > Theorem proving paradigm > Programs as sets of clauses: facts, rules and questions > Computation by “unification” Successes > Prototypical logic programming language > Used in Japanese Fifth Generation Initiative
  • 23. 1.23 “Hello World” in Prolog hello :- printstring("HELLO WORLD!!!!"). printstring([]). printstring([H|T]) :- put(H), printstring(T).
  • 24. 1.24 Object-Oriented Languages History > Simula was developed by Nygaard and Dahl (early 1960s) in Oslo as a language for simulation programming, by adding classes and inheritance to ALGOL 60 > Smalltalk was developed by Xerox PARC (early 1970s) to drive graphic workstations Begin while 1 = 1 do begin outtext ("Hello World!"); outimage; end; End; Transcript show:'Hello World';cr
  • 25. 1.25 Object-Oriented Languages Innovations > Encapsulation of data and operations (contrast ADTs) > Inheritance to share behaviour and interfaces Successes > Smalltalk project pioneered OO user interfaces > Large commercial impact since mid 1980s > Countless new languages: C++, Objective C, Eiffel, Beta, Oberon, Self, Perl 5, Python, Java, Ada 95 ...
  • 26. 1.26 Interactive Languages Made possible by advent of time-sharing systems (early 1960s through mid 1970s). BASIC > Developed at Dartmouth College in mid 1960s > Minimal; easy to learn > Incorporated basic O/S commands (NEW, LIST, DELETE, RUN, SAVE) ... 10 print "Hello World!" 20 goto 10
  • 27. 1.27 Interactive Languages ... APL > Developed by Ken Iverson for concise description of numerical algorithms > Large, non-standard alphabet (52 characters in addition to alphanumerics) > Primitive objects are arrays (lists, tables or matrices) > Operator-driven (power comes from composing array operators) > No operator precedence (statements parsed right to left) 'HELLO WORLD'
  • 28. 1.28 Special-Purpose Languages SNOBOL > First successful string manipulation language > Influenced design of text editors more than other PLs > String operations: pattern-matching and substitution > Arrays and associative arrays (tables) > Variable-length strings ... OUTPUT = 'Hello World!' END
  • 29. 1.29 Symbolic Languages ... Lisp > Performs computations on symbolic expressions > Symbolic expressions are represented as lists > Small set of constructor/selector operations to create and manipulate lists > Recursive rather than iterative control > No distinction between data and programs > First PL to implement storage management by garbage collection > Affinity with lambda calculus (DEFUN HELLO-WORLD () (PRINT (LIST 'HELLO 'WORLD)))
  • 30. 1.30 4GLs “Problem-oriented” languages > PLs for “non-programmers” > Very High Level (VHL) languages for specific problem domains Classes of 4GLs (no clear boundaries) > Report Program Generator (RPG) > Application generators > Query languages > Decision-support languages Successes > Highly popular, but generally ad hoc
  • 31. 1.31 “Hello World” in RPG H FSCREEN O F 80 80 CRT C EXCPT OSCREEN E 1 O 12 'HELLO WORLD!'
  • 32. 1.32 “Hello World” in SQL CREATE TABLE HELLO (HELLO CHAR(12)) UPDATE HELLO SET HELLO = 'HELLO WORLD!' SELECT * FROM HELLO
  • 33. 1.33 Scripting Languages History Countless “shell languages” and “command languages” for operating systems and configurable applications echo "Hello, World!" on OpenStack show message box put "Hello World!" into message box end OpenStack puts "Hello World " print "Hello, World!n"; > Unix shell (ca. 1971) developed as user shell and scripting tool > HyperTalk (1987) was developed at Apple to script HyperCard stacks > TCL (1990) developed as embedding language and scripting language for X windows applications (via Tk) > Perl (~1990) became de facto web scripting language
  • 34. 1.34 Scripting Languages ... Innovations > Pipes and filters (Unix shell) > Generalized embedding/command languages (TCL) Successes > Unix Shell, awk, emacs, HyperTalk, AppleTalk, TCL, Python, Perl, VisualBasic ...
  • 35. The future? > Dynamic languages — very active > Domain-specific languages — very active > Visual languages — many developments, but still immature > Modeling languages — emerging from UML and MDE … © Oscar Nierstrasz Safety Patterns 35
  • 36. 1.36 What you should know!  What, exactly, is a programming language?  How do compilers and interpreters differ?  Why was FORTRAN developed?  What were the main achievements of ALGOL 60?  Why do we call C a “Third Generation Language”?  What is a “Fourth Generation Language”?
  • 37. 1.37 Can you answer these questions?  Why are there so many programming languages?  Why are FORTRAN and COBOL still important programming languages?  Which language should you use to implement a spelling checker?  A filter to translate upper-to-lower case?  A theorem prover?  An address database?  An expert system?  A game server for initiating chess games on the internet?  A user interface for a network chess client?