SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
CS 314, LS,LTM: L1: Introduction 1
Principles ofPrinciples of
Programming LanguagesProgramming Languages
Topic: Introduction
Professor Louis Steinberg
CS 314, LS,LTM: L1: Introduction 2
ContactsContacts
• Prof. Louis Steinberg
– lou @ cs.rutgers.edu
– x5-3581
– 401 Hill
• TA:
– to be announced
• Class web site
http: //www.remus.rutgers/cs314/steinberg
CS 314, LS,LTM: L1: Introduction 3
BooksBooks
• Kenneth Louden, “Programming Languages”
• Kenneth Reek, “Pointers on C”
• Kip Irvine, “C++ and Object-Oriented
Programming”
• Clocksin & Mellish, “Programming in Prolog”
CS 314, LS,LTM: L1: Introduction 4
WorkWork
• Midterm (Friday 3/5 2:50-4:10PM )
• Final
• 3 projects
• Homework
• In-lab programming test (?)
CS 314, LS,LTM: L1: Introduction 5
TopicsTopics
• Introduction
• Formal Languages - RE’s, BNF, context-free grammars,
parsing
• Functional Programming (Scheme)
• Names, Bindings, Memory management
• Imperative Programming (C)
• Parameter Passing
• ADT’s, Object-oriented Design (C++)
• Logic Programming (Prolog)
• Types
• Parallel Programming? Threads and monitors?
CS 314, LS,LTM: L1: Introduction 6
Course GoalsCourse Goals
• To gain an understanding of the basic structure of
programming languages:
– Data types, control structures, naming conventions,...
• To learn the principles underlying all programming
languages:
– So that it is easier to learn new languages
• To study different language paradigms:
– Functional (Scheme), Imperative (C), Object-Oriented
(C++, Java), Logic (Prolog)
– So that you can select an appropriate language for a task
CS 314, LS,LTM: L1: Introduction 7
What is a programmingWhat is a programming
language?language?
“a language intended for use by a person to express a process
by which a computer can solve a problem” -Hope and
Jipping
“a set of conventions for communicating an algorithm” - E.
Horowitz
“ the art of programming is the art of organizing complexity” -
Dijkstra, 1972
CS 314, LS,LTM: L1: Introduction 8
AnthropomorphismAnthropomorphism
• Whenever a human term (e.g., ‘language’) is used
about computers, ask:
• How analogous
• How differs
CS 314, LS,LTM: L1: Introduction 10
Desiderata for PL DesignDesiderata for PL Design
• Readable
– comments, names, (…) syntax
• Simple to learn
– Orthogonal - small number of concepts combine
regularly and systematically (without exceptions)
• Portable
– language standardization
• Abstraction
– control and data structures that hide detail
• Efficient
CS 314, LS,LTM: L1: Introduction 11
Why learn more than one PL?Why learn more than one PL?
• So you can choose the right language for a given
problem
– If all you have is a hammer, every problem looks like a
nail
CS 314, LS,LTM: L1: Introduction 12
Why learn more than one PL?Why learn more than one PL?
• So you can learn a new language more easily later
– As your job changes, you may need to used different
languages
– As our understanding of programming improves, new
languages are created
• To learn new ways of thinking about problems
– Different languages encourage you to think about
problems in different ways
– “Paradigms”
CS 314, LS,LTM: L1: Introduction 13
What is a ParadigmWhat is a Paradigm
• A way of looking at a problem and seeing a
program
– What kind of parts do you look for?
• Problem: Print a “large X” of size n.
– E.g., size 5 is X X
X X
X
X X
X X
CS 314, LS,LTM: L1: Introduction 17
Imperative ParadigmImperative Paradigm
• A program is: A sequence of state-changing actions
• Manipulate an abstract machine with:
– Variables that name memory locations
– Arithmetic and logical operations
– Reference, evaluate, assign operations
– Explicit control flow statements
• Fits the Von Neumann architecture closely
• Key operations: Assignment and “GoTo”
CS 314, LS,LTM: L1: Introduction 18
Imperative ParadigmImperative Paradigm
Fortran
C
SUM = 0
DO 11 K=1,N
SUM = SUM + 2*K
11 CONTINUE
sum = 0;
for (k = 1; k <= n; ++k)
sum += 2*k;
sum := 0;
for k := 1 to n do
sum := sum + 2*k;
Pascal
Sum up twice each
number from 1 to N.
CS 314, LS,LTM: L1: Introduction 19
Functional ParadigmFunctional Paradigm
• A program is: Composition of operations on data
• Characteristics (in pure form):
– Name values, not memory locations
– Value binding through parameter passing
– Recursion rather than iteration
• Key operations: Function Application and Function
Abstraction
– Based on the Lambda Calculus
CS 314, LS,LTM: L1: Introduction 20
Functional ParadigmFunctional Paradigm
(define (sum n)
(if (= n 0)
0
(+ (* n 2) (sum (- n 1)))
)
)
(sum 4) evaluates to 20
Scheme
CS 314, LS,LTM: L1: Introduction 21
Logic ParadigmLogic Paradigm
• A program is: Formal logical specification of
problem
• Characteristics (in pure form):
– Programs say what properties the solution must have, not
how to find it
– Solutions are obtained through a specialized form of
theorem-proving
• Key operations: Unification and NonDeterministic
Search
– Based on First Order Predicate Logic
CS 314, LS,LTM: L1: Introduction 22
Logic ParadigmLogic Paradigm
sum(0,0).
sum(N,S) :- N>0,
NN is N - 1,
sum(NN, SS),
S is N * 2 + SS.
?- sum(1,2).
yes
?- sum (2,4).
no
?-sum(20,S).
S = 420
?-sum (X,Y).
X = 0 = Y
Prolog
CS 314, LS,LTM: L1: Introduction 23
Object-Oriented ParadigmObject-Oriented Paradigm
• A program is: Communication between abstract
objects
• Characteristics:
– “Objects” collect both the data and the operations
– “Objects” provide data abstraction
– Can be either imperative or functional (or logical)
• Key operation: Message Passing or Method
Invocation
CS 314, LS,LTM: L1: Introduction 24
Object-oriented ParadigmObject-oriented Paradigm
class intSet : public Set
{ public: intSet() { }
//inherits Set add_element(), Set del_element()
//from Set class, defined as a set of Objects
public int sum( ){
int s = 0;
SetEnumeration e = new SetEnumeration(this);
while (e.hasMoreElements()) do
{s = s + ((Integer)e.nextElement()).intValue();}
return s;
}
}
Java
CS 314, LS,LTM: L1: Introduction 25
TranslationTranslation
• Compilation: Program is translated from a high-
level language into a form that is executable on an
actual machine
• Interpretation: Program is translated and executed
one statement at a time by a “virtual machine”
• Some PL systems are a mixture of these two
– E.g., Java
Translator
Virtual Machine
Source Intermediate code
Input
Intermediate code Output
foo.java foo.class
bytecodejavac
java (JVM)
CS 314, LS,LTM: L1: Introduction 26
CompilationCompilation
scanner
parser
intermediate
code
generator
optimizer
code generator
assembler
linker
CS 314, LS,LTM: L1: Introduction 27
CompilationCompilation
scanner
parser
intermediate
code
generator
position = initial + rate * 60;
id1 := id2 + id3 * 60
optimizer
code generator
assembler
linker
CS 314, LS,LTM: L1: Introduction 28
CompilationCompilation
scanner
parser
intermediate
code
generator
symbol table
(position, ...)
(initial, …)
(rate, …)
:= parse tree
id1 +
id2 *
id3 int-to-real
60
tmp1 = inttoreal (60)
tmp2 = id3 * tmp1
tmp3 = id2 + tmp2
id1 = tmp3
CS 314, LS,LTM: L1: Introduction 29
CompilationCompilation
optimizer
code generator
assembler
linker
tmp2 = id3 * 60.0
id1 = id2 + tmp2
movf id3, R2
mulf #60.0, R2
movf id2, R1
addf R2, R1
movf R1, id1 move R1, R-base, R-offset
…
movf R1, 45733
CS 314, LS,LTM: L1: Introduction 30
History ofHistory of PLsPLs
• Prehistory
– 300 B.C. Greece, Euclid invented the greatest common
divisor algorithm - oldest known algorithm
– ~1820-1850 England, Charles Babbage invented two
mechanical computational devices
• difference engine
• analytical engine
• Countess Ada Augusta of Lovelace, first computer programmer
– Precursors to modern machines
• 1940’s United States, ENIAC developed to calculate trajectories
CS 314, LS,LTM: L1: Introduction 31
History ofHistory of PLsPLs
• 1950’s United States, first high-level PLs invented
– Fortran 1954-57, John Backus (IBM on 704) designed for
numerical scientific computation
• fixed format for punched cards
• implicit typing
• only counting loops, if test versus zero
• only numerical data
• 1957 optimizing Fortran compiler translates into code as efficient
as hand-coded
CS 314, LS,LTM: L1: Introduction 32
History ofHistory of PLsPLs
– Algol60 1958-60, designed by international committee for
numerical scientific computation [Fortran]
• block structure with lexical scope
• free format, reserved words
• while loops, recursion
• explicit types
• BNF developed for formal syntax definition
– Cobol 1959-60, designed by committee in US,
manufacturers and DoD for business data processing
• records
• focus on file handling
• English-like syntax
CS 314, LS,LTM: L1: Introduction 33
History ofHistory of PLsPLs
– APL 1956-60 Ken Iverson, (IBM on 360, Harvard)
designed for array processing
• functional programming style
– LISP 1956-62, John McCarthy (MIT on IBM704,
Stanford) designed for non-numerical computation
• uniform notation for program and data
• recursion as main control structure
• garbage collection
– Snobol 1962-66, Farber, Griswold, Polansky (Bell Labs)
designed for string processing
• powerful pattern matching
CS 314, LS,LTM: L1: Introduction 34
History ofHistory of PLsPLs
– PL/I 1963-66, IBM designed for general purpose
computing [Fortran, Algol60, Cobol]
• user controlled exceptions
• multi-tasking
– Simula67 1967, Dahl and Nygaard (Norway) designed as
a simulation language [Algol60]
• data abstraction
• inheritance of properties
– Algol68 1963-68, designed for general purpose computing
[Algol60]
• orthogonal language design
• interesting user defined types
CS 314, LS,LTM: L1: Introduction 35
History ofHistory of PLsPLs
– Pascal 1969, N. Wirth(ETH) designed for teaching
programming [Algol60]
• 1 pass compiler
• call-by-value semantics
– Prolog 1972, Colmerauer and Kowalski designed for
Artificial Intelligence applications
• theorem proving with unification as basic operation
• logic programming
• Recent
– C 1974, D. Ritchie (Bell Labs) designed for systems
programming
• allows access to machine level within high-level PL
• efficient code generated
CS 314, LS,LTM: L1: Introduction 36
History ofHistory of PLsPLs
– Clu 1974-77, B. Liskov (MIT) designed for simulation
[Simula]
• supports data abstraction and exceptions
• precise algebraic language semantics
• attempt to enable verification of programs
– Smalltalk mid-1970s, Alan Kay (Xerox Parc), considered
first real object-oriented PL, [Simula]
• encapsulation, inheritance
• easy to prototype applications
• hides details of underlying machine
– Scheme mid-1970s, Guy Steele, Gerald Sussman (MIT)
• Static scoping and first-class functions
CS 314, LS,LTM: L1: Introduction 37
History ofHistory of PLsPLs
– Concurrent Pascal 1976 Per Brinch Hansen (U Syracuse)
designed for asynchronous concurrent processing
[Pascal]
• monitors for safe data sharing
– Modula 1977 N. Wirth (ETH), designed language for
large software development [Pascal]
• to control interfaces between sets of procedures or modules
• real-time programming
– Ada 1979, US DoD committee designed as general
purpose PL
• explicit parallelism - rendezvous
• exception handling and generics (packages)
CS 314, LS,LTM: L1: Introduction 38
History ofHistory of PLsPLs
– C++ 1985, Bjorne Stroustrup (Bell Labs) general purpose
• goal of type-safe object-oriented PL
• compile-time type checking
• templates
– Java ~1995, J. Gosling (SUN)
• aimed at portability across platform through use of JVM -
abstract machine to implement the PL
• aimed to fix some problems with previous OOPLs
¨ multiple inheritance
¨ static and dynamic objects
• ubiquitous exceptions
• thread objects
CS 314, LS,LTM: L1: Introduction 39
http://www.http://www.oreillyoreilly.com/pub/a/.com/pub/a/oreillyoreilly/news//news/languageposterlanguageposter_0504.html_0504.html

Mais conteúdo relacionado

Destaque

How New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesHow New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesStarr Long
 
Daily option news letter 11 july 2013
Daily option news letter 11 july 2013Daily option news letter 11 july 2013
Daily option news letter 11 july 2013Rakhi Tips Provider
 
งานคอมครูเขื่อนคันธารัตน์
งานคอมครูเขื่อนคันธารัตน์งานคอมครูเขื่อนคันธารัตน์
งานคอมครูเขื่อนคันธารัตน์noeiinoii
 
7 สามัญ ภาษาไทย
7 สามัญ ภาษาไทย7 สามัญ ภาษาไทย
7 สามัญ ภาษาไทยnoeiinoii
 
ใบงานท 9-16
ใบงานท   9-16ใบงานท   9-16
ใบงานท 9-16noeiinoii
 
Gcc bio team-presentation
Gcc bio team-presentationGcc bio team-presentation
Gcc bio team-presentationanushkanet
 
4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetariumdwhobrey
 
Daily agri news letter 25 july 2013
Daily agri news letter 25 july 2013Daily agri news letter 25 july 2013
Daily agri news letter 25 july 2013Rakhi Tips Provider
 
Daily option news letter 30 july 2013
Daily option news letter 30 july 2013Daily option news letter 30 july 2013
Daily option news letter 30 july 2013Rakhi Tips Provider
 
Fomalhaut en gi neering
Fomalhaut en gi neeringFomalhaut en gi neering
Fomalhaut en gi neeringARSLAN AHMED
 
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...IRIB
 
Tu do kinh doanh cung qnet viet nam business planner-en
Tu do kinh doanh cung qnet viet nam business planner-enTu do kinh doanh cung qnet viet nam business planner-en
Tu do kinh doanh cung qnet viet nam business planner-enLâm Võ
 
I page coupons
I page couponsI page coupons
I page couponsipageass2
 
Activity 8: Web 2.0
Activity 8: Web 2.0Activity 8: Web 2.0
Activity 8: Web 2.0AstuteFL
 

Destaque (20)

How New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming ExperiencesHow New Tech is Innovating Gaming Experiences
How New Tech is Innovating Gaming Experiences
 
Catálogo kinetic
Catálogo kineticCatálogo kinetic
Catálogo kinetic
 
Pragmatic Paradigm of Setting Up Schools- Kerala Experience
Pragmatic Paradigm of Setting Up Schools- Kerala ExperiencePragmatic Paradigm of Setting Up Schools- Kerala Experience
Pragmatic Paradigm of Setting Up Schools- Kerala Experience
 
Daily option news letter 11 july 2013
Daily option news letter 11 july 2013Daily option news letter 11 july 2013
Daily option news letter 11 july 2013
 
งานคอมครูเขื่อนคันธารัตน์
งานคอมครูเขื่อนคันธารัตน์งานคอมครูเขื่อนคันธารัตน์
งานคอมครูเขื่อนคันธารัตน์
 
7 สามัญ ภาษาไทย
7 สามัญ ภาษาไทย7 สามัญ ภาษาไทย
7 สามัญ ภาษาไทย
 
Fb content images
Fb content imagesFb content images
Fb content images
 
ใบงานท 9-16
ใบงานท   9-16ใบงานท   9-16
ใบงานท 9-16
 
Internationale Newsletter Vol 2 Iss 3 June 2014
Internationale Newsletter Vol 2 Iss 3 June 2014Internationale Newsletter Vol 2 Iss 3 June 2014
Internationale Newsletter Vol 2 Iss 3 June 2014
 
Castors
CastorsCastors
Castors
 
Gcc bio team-presentation
Gcc bio team-presentationGcc bio team-presentation
Gcc bio team-presentation
 
St lucia minister expands legal threat to media
St lucia minister expands legal threat to mediaSt lucia minister expands legal threat to media
St lucia minister expands legal threat to media
 
4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium
 
Daily agri news letter 25 july 2013
Daily agri news letter 25 july 2013Daily agri news letter 25 july 2013
Daily agri news letter 25 july 2013
 
Daily option news letter 30 july 2013
Daily option news letter 30 july 2013Daily option news letter 30 july 2013
Daily option news letter 30 july 2013
 
Fomalhaut en gi neering
Fomalhaut en gi neeringFomalhaut en gi neering
Fomalhaut en gi neering
 
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...
Apresentação de produtos e serviços diferenciados para cartórios: Cartão de c...
 
Tu do kinh doanh cung qnet viet nam business planner-en
Tu do kinh doanh cung qnet viet nam business planner-enTu do kinh doanh cung qnet viet nam business planner-en
Tu do kinh doanh cung qnet viet nam business planner-en
 
I page coupons
I page couponsI page coupons
I page coupons
 
Activity 8: Web 2.0
Activity 8: Web 2.0Activity 8: Web 2.0
Activity 8: Web 2.0
 

Semelhante a Topic01 intro.post

The joy of functional programming
The joy of functional programmingThe joy of functional programming
The joy of functional programmingSteve Zhang
 
Survey of Program Transformation Technologies
Survey of Program Transformation TechnologiesSurvey of Program Transformation Technologies
Survey of Program Transformation TechnologiesChunhua Liao
 
Compiler Design
Compiler DesignCompiler Design
Compiler DesignMir Majid
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTWAdriano Bonat
 
Can programming be liberated from the von neumann style?
Can programming be liberated from the von neumann style?Can programming be liberated from the von neumann style?
Can programming be liberated from the von neumann style?Oriol López Massaguer
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...Jose Quesada (hiring)
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneJames Long
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...Lucidworks
 
Deep Learning for Search: Personalization and Deep Tokenization
Deep Learning for Search: Personalization and Deep TokenizationDeep Learning for Search: Personalization and Deep Tokenization
Deep Learning for Search: Personalization and Deep TokenizationJake Mannix
 
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...Gábor Szárnyas
 
Lisp, An Introduction.ppt
Lisp, An Introduction.pptLisp, An Introduction.ppt
Lisp, An Introduction.pptLuis Soza
 

Semelhante a Topic01 intro.post (20)

Introduction
IntroductionIntroduction
Introduction
 
Introduction
IntroductionIntroduction
Introduction
 
The joy of functional programming
The joy of functional programmingThe joy of functional programming
The joy of functional programming
 
Paradigms
ParadigmsParadigms
Paradigms
 
Survey of Program Transformation Technologies
Survey of Program Transformation TechnologiesSurvey of Program Transformation Technologies
Survey of Program Transformation Technologies
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
 
Can programming be liberated from the von neumann style?
Can programming be liberated from the von neumann style?Can programming be liberated from the von neumann style?
Can programming be liberated from the von neumann style?
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhone
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...
Deep Learning for Unified Personalized Search and Recommendations - Jake Mann...
 
Deep Learning for Search: Personalization and Deep Tokenization
Deep Learning for Search: Personalization and Deep TokenizationDeep Learning for Search: Personalization and Deep Tokenization
Deep Learning for Search: Personalization and Deep Tokenization
 
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
 
LISP.ppt
LISP.pptLISP.ppt
LISP.ppt
 
Return of c++
Return of c++Return of c++
Return of c++
 
intro.ppt
intro.pptintro.ppt
intro.ppt
 
Lisp, An Introduction.ppt
Lisp, An Introduction.pptLisp, An Introduction.ppt
Lisp, An Introduction.ppt
 

Último

Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 

Último (20)

Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 

Topic01 intro.post

  • 1. CS 314, LS,LTM: L1: Introduction 1 Principles ofPrinciples of Programming LanguagesProgramming Languages Topic: Introduction Professor Louis Steinberg
  • 2. CS 314, LS,LTM: L1: Introduction 2 ContactsContacts • Prof. Louis Steinberg – lou @ cs.rutgers.edu – x5-3581 – 401 Hill • TA: – to be announced • Class web site http: //www.remus.rutgers/cs314/steinberg
  • 3. CS 314, LS,LTM: L1: Introduction 3 BooksBooks • Kenneth Louden, “Programming Languages” • Kenneth Reek, “Pointers on C” • Kip Irvine, “C++ and Object-Oriented Programming” • Clocksin & Mellish, “Programming in Prolog”
  • 4. CS 314, LS,LTM: L1: Introduction 4 WorkWork • Midterm (Friday 3/5 2:50-4:10PM ) • Final • 3 projects • Homework • In-lab programming test (?)
  • 5. CS 314, LS,LTM: L1: Introduction 5 TopicsTopics • Introduction • Formal Languages - RE’s, BNF, context-free grammars, parsing • Functional Programming (Scheme) • Names, Bindings, Memory management • Imperative Programming (C) • Parameter Passing • ADT’s, Object-oriented Design (C++) • Logic Programming (Prolog) • Types • Parallel Programming? Threads and monitors?
  • 6. CS 314, LS,LTM: L1: Introduction 6 Course GoalsCourse Goals • To gain an understanding of the basic structure of programming languages: – Data types, control structures, naming conventions,... • To learn the principles underlying all programming languages: – So that it is easier to learn new languages • To study different language paradigms: – Functional (Scheme), Imperative (C), Object-Oriented (C++, Java), Logic (Prolog) – So that you can select an appropriate language for a task
  • 7. CS 314, LS,LTM: L1: Introduction 7 What is a programmingWhat is a programming language?language? “a language intended for use by a person to express a process by which a computer can solve a problem” -Hope and Jipping “a set of conventions for communicating an algorithm” - E. Horowitz “ the art of programming is the art of organizing complexity” - Dijkstra, 1972
  • 8. CS 314, LS,LTM: L1: Introduction 8 AnthropomorphismAnthropomorphism • Whenever a human term (e.g., ‘language’) is used about computers, ask: • How analogous • How differs
  • 9. CS 314, LS,LTM: L1: Introduction 10 Desiderata for PL DesignDesiderata for PL Design • Readable – comments, names, (…) syntax • Simple to learn – Orthogonal - small number of concepts combine regularly and systematically (without exceptions) • Portable – language standardization • Abstraction – control and data structures that hide detail • Efficient
  • 10. CS 314, LS,LTM: L1: Introduction 11 Why learn more than one PL?Why learn more than one PL? • So you can choose the right language for a given problem – If all you have is a hammer, every problem looks like a nail
  • 11. CS 314, LS,LTM: L1: Introduction 12 Why learn more than one PL?Why learn more than one PL? • So you can learn a new language more easily later – As your job changes, you may need to used different languages – As our understanding of programming improves, new languages are created • To learn new ways of thinking about problems – Different languages encourage you to think about problems in different ways – “Paradigms”
  • 12. CS 314, LS,LTM: L1: Introduction 13 What is a ParadigmWhat is a Paradigm • A way of looking at a problem and seeing a program – What kind of parts do you look for? • Problem: Print a “large X” of size n. – E.g., size 5 is X X X X X X X X X
  • 13. CS 314, LS,LTM: L1: Introduction 17 Imperative ParadigmImperative Paradigm • A program is: A sequence of state-changing actions • Manipulate an abstract machine with: – Variables that name memory locations – Arithmetic and logical operations – Reference, evaluate, assign operations – Explicit control flow statements • Fits the Von Neumann architecture closely • Key operations: Assignment and “GoTo”
  • 14. CS 314, LS,LTM: L1: Introduction 18 Imperative ParadigmImperative Paradigm Fortran C SUM = 0 DO 11 K=1,N SUM = SUM + 2*K 11 CONTINUE sum = 0; for (k = 1; k <= n; ++k) sum += 2*k; sum := 0; for k := 1 to n do sum := sum + 2*k; Pascal Sum up twice each number from 1 to N.
  • 15. CS 314, LS,LTM: L1: Introduction 19 Functional ParadigmFunctional Paradigm • A program is: Composition of operations on data • Characteristics (in pure form): – Name values, not memory locations – Value binding through parameter passing – Recursion rather than iteration • Key operations: Function Application and Function Abstraction – Based on the Lambda Calculus
  • 16. CS 314, LS,LTM: L1: Introduction 20 Functional ParadigmFunctional Paradigm (define (sum n) (if (= n 0) 0 (+ (* n 2) (sum (- n 1))) ) ) (sum 4) evaluates to 20 Scheme
  • 17. CS 314, LS,LTM: L1: Introduction 21 Logic ParadigmLogic Paradigm • A program is: Formal logical specification of problem • Characteristics (in pure form): – Programs say what properties the solution must have, not how to find it – Solutions are obtained through a specialized form of theorem-proving • Key operations: Unification and NonDeterministic Search – Based on First Order Predicate Logic
  • 18. CS 314, LS,LTM: L1: Introduction 22 Logic ParadigmLogic Paradigm sum(0,0). sum(N,S) :- N>0, NN is N - 1, sum(NN, SS), S is N * 2 + SS. ?- sum(1,2). yes ?- sum (2,4). no ?-sum(20,S). S = 420 ?-sum (X,Y). X = 0 = Y Prolog
  • 19. CS 314, LS,LTM: L1: Introduction 23 Object-Oriented ParadigmObject-Oriented Paradigm • A program is: Communication between abstract objects • Characteristics: – “Objects” collect both the data and the operations – “Objects” provide data abstraction – Can be either imperative or functional (or logical) • Key operation: Message Passing or Method Invocation
  • 20. CS 314, LS,LTM: L1: Introduction 24 Object-oriented ParadigmObject-oriented Paradigm class intSet : public Set { public: intSet() { } //inherits Set add_element(), Set del_element() //from Set class, defined as a set of Objects public int sum( ){ int s = 0; SetEnumeration e = new SetEnumeration(this); while (e.hasMoreElements()) do {s = s + ((Integer)e.nextElement()).intValue();} return s; } } Java
  • 21. CS 314, LS,LTM: L1: Introduction 25 TranslationTranslation • Compilation: Program is translated from a high- level language into a form that is executable on an actual machine • Interpretation: Program is translated and executed one statement at a time by a “virtual machine” • Some PL systems are a mixture of these two – E.g., Java Translator Virtual Machine Source Intermediate code Input Intermediate code Output foo.java foo.class bytecodejavac java (JVM)
  • 22. CS 314, LS,LTM: L1: Introduction 26 CompilationCompilation scanner parser intermediate code generator optimizer code generator assembler linker
  • 23. CS 314, LS,LTM: L1: Introduction 27 CompilationCompilation scanner parser intermediate code generator position = initial + rate * 60; id1 := id2 + id3 * 60 optimizer code generator assembler linker
  • 24. CS 314, LS,LTM: L1: Introduction 28 CompilationCompilation scanner parser intermediate code generator symbol table (position, ...) (initial, …) (rate, …) := parse tree id1 + id2 * id3 int-to-real 60 tmp1 = inttoreal (60) tmp2 = id3 * tmp1 tmp3 = id2 + tmp2 id1 = tmp3
  • 25. CS 314, LS,LTM: L1: Introduction 29 CompilationCompilation optimizer code generator assembler linker tmp2 = id3 * 60.0 id1 = id2 + tmp2 movf id3, R2 mulf #60.0, R2 movf id2, R1 addf R2, R1 movf R1, id1 move R1, R-base, R-offset … movf R1, 45733
  • 26. CS 314, LS,LTM: L1: Introduction 30 History ofHistory of PLsPLs • Prehistory – 300 B.C. Greece, Euclid invented the greatest common divisor algorithm - oldest known algorithm – ~1820-1850 England, Charles Babbage invented two mechanical computational devices • difference engine • analytical engine • Countess Ada Augusta of Lovelace, first computer programmer – Precursors to modern machines • 1940’s United States, ENIAC developed to calculate trajectories
  • 27. CS 314, LS,LTM: L1: Introduction 31 History ofHistory of PLsPLs • 1950’s United States, first high-level PLs invented – Fortran 1954-57, John Backus (IBM on 704) designed for numerical scientific computation • fixed format for punched cards • implicit typing • only counting loops, if test versus zero • only numerical data • 1957 optimizing Fortran compiler translates into code as efficient as hand-coded
  • 28. CS 314, LS,LTM: L1: Introduction 32 History ofHistory of PLsPLs – Algol60 1958-60, designed by international committee for numerical scientific computation [Fortran] • block structure with lexical scope • free format, reserved words • while loops, recursion • explicit types • BNF developed for formal syntax definition – Cobol 1959-60, designed by committee in US, manufacturers and DoD for business data processing • records • focus on file handling • English-like syntax
  • 29. CS 314, LS,LTM: L1: Introduction 33 History ofHistory of PLsPLs – APL 1956-60 Ken Iverson, (IBM on 360, Harvard) designed for array processing • functional programming style – LISP 1956-62, John McCarthy (MIT on IBM704, Stanford) designed for non-numerical computation • uniform notation for program and data • recursion as main control structure • garbage collection – Snobol 1962-66, Farber, Griswold, Polansky (Bell Labs) designed for string processing • powerful pattern matching
  • 30. CS 314, LS,LTM: L1: Introduction 34 History ofHistory of PLsPLs – PL/I 1963-66, IBM designed for general purpose computing [Fortran, Algol60, Cobol] • user controlled exceptions • multi-tasking – Simula67 1967, Dahl and Nygaard (Norway) designed as a simulation language [Algol60] • data abstraction • inheritance of properties – Algol68 1963-68, designed for general purpose computing [Algol60] • orthogonal language design • interesting user defined types
  • 31. CS 314, LS,LTM: L1: Introduction 35 History ofHistory of PLsPLs – Pascal 1969, N. Wirth(ETH) designed for teaching programming [Algol60] • 1 pass compiler • call-by-value semantics – Prolog 1972, Colmerauer and Kowalski designed for Artificial Intelligence applications • theorem proving with unification as basic operation • logic programming • Recent – C 1974, D. Ritchie (Bell Labs) designed for systems programming • allows access to machine level within high-level PL • efficient code generated
  • 32. CS 314, LS,LTM: L1: Introduction 36 History ofHistory of PLsPLs – Clu 1974-77, B. Liskov (MIT) designed for simulation [Simula] • supports data abstraction and exceptions • precise algebraic language semantics • attempt to enable verification of programs – Smalltalk mid-1970s, Alan Kay (Xerox Parc), considered first real object-oriented PL, [Simula] • encapsulation, inheritance • easy to prototype applications • hides details of underlying machine – Scheme mid-1970s, Guy Steele, Gerald Sussman (MIT) • Static scoping and first-class functions
  • 33. CS 314, LS,LTM: L1: Introduction 37 History ofHistory of PLsPLs – Concurrent Pascal 1976 Per Brinch Hansen (U Syracuse) designed for asynchronous concurrent processing [Pascal] • monitors for safe data sharing – Modula 1977 N. Wirth (ETH), designed language for large software development [Pascal] • to control interfaces between sets of procedures or modules • real-time programming – Ada 1979, US DoD committee designed as general purpose PL • explicit parallelism - rendezvous • exception handling and generics (packages)
  • 34. CS 314, LS,LTM: L1: Introduction 38 History ofHistory of PLsPLs – C++ 1985, Bjorne Stroustrup (Bell Labs) general purpose • goal of type-safe object-oriented PL • compile-time type checking • templates – Java ~1995, J. Gosling (SUN) • aimed at portability across platform through use of JVM - abstract machine to implement the PL • aimed to fix some problems with previous OOPLs ¨ multiple inheritance ¨ static and dynamic objects • ubiquitous exceptions • thread objects
  • 35. CS 314, LS,LTM: L1: Introduction 39 http://www.http://www.oreillyoreilly.com/pub/a/.com/pub/a/oreillyoreilly/news//news/languageposterlanguageposter_0504.html_0504.html