SlideShare une entreprise Scribd logo
1  sur  25
INTEGRATIVE
PROGRAMMING
ALGORITHM
• Abu Ja’far Muhammad ibn Musa
al-Khorezmi (“from Khorezm”)
• Lived in Baghdad around 780 – 850 AD
• Chief mathematician in Khalif Al Mamun’s “House
of Wisdom”
• Author of “A Compact Introduction To Calculation
Using Rules Of Completion And Reduction”
“CALCULUS OF THOUGHT”
• Gottfried Wilhelm Leibniz
• 1646 - 1716
• Inventor of calculus and binary system
• “Calculus ratiocinator”: human reasoning can be
reduced to a formal symbolic language, in which all
arguments would be settled by mechanical
manipulation of logical concepts
• Invented a mechanical calculator
FORMALISMS FOR COMPUTATION
• Predicate logic
• Gottlöb Frege (1848-1925)
• Formal basis for proof theory and
automated theorem proving
• Logic programming
• Computation as logical deduction
• Turing machines
• Alan Turing (1912-1954)
• Imperative programming
• Sequences of commands, explicit state
transitions, update via assignment
FORMALISMS FOR COMPUTATION
• Lambda calculus
• Alonzo Church (1903-1995)
• Formal basis for all functional
languages, semantics, type theory
• Functional programming
Recursive functions & automata
• Stephen Kleene (1909-1994)
• Regular expressions, finite-state
machines, PDAs
CHURCH’S LEGACY
Alonzo Church (PhD Princeton 1927)
Hartley Rogers (PhD Princeton 1952)
Albert Meyer (PhD Harvard 1972)
Vitaly Shmatikov (PhD Stanford 2000)
John Mitchell (PhD MIT 1984)
…
1916 other
academic
descendants
Recursion theory
Semantics, concurrency
Theory of object-oriented languages
CHURCH’S THESIS
• All these different syntactic formalisms describe the same
class of mathematical objects
• Church’s Thesis: “Every effectively calculable function
(effectively decidable predicate) is general recursive”
• Turing’s Thesis: “Every function which would be
naturally regarded as computable is computable by a
Turing machine”
• Recursion, lambda-calculus and Turing machines are
equivalent in their expressive power.
FORMALISMS FOR COMPUTATION
• Combinatory logic
• Moses Schönfinkel (1889-1942??)
• Haskell Curry (1900-1982)
• Post production systems
• Emil Post (1897-1954)
• Markov algorithms
• Andrey Markov (1903-1979)
PROGRAMMING LANGUAGE
• Formal notation for specifying computations
• Syntax (usually specified by a context-free grammar)
• Semantics for each syntactic construct
• Translation vs. compilation vs. interpretation
• C++ was originally translated into C by
Stroustrup’s Cfront
• Java originally used a bytecode interpreter, now
native code compilers are commonly used for
greater efficiency.
THE BINARY MACHINE
• A modern computer can run programs written in
JavaScript, Pascal, Visual Basic, Visual C++, etc.
• However, computers can only understand one language:
the machine language it is not easy to use.
• The machine language of a Sun workstation is different
from a PC (or other platform), however, they can run the
same C++ program.
TWO TYPES OF TRANSLATORS
• Interpreter:
• translate and run the source code one line at a
time. Easy to write and easy to find the errors in
the program, but running very slow.
• JavaScript, VBScript, PHP, …
• Compiler:
• translates the source code once and for all,
producing a complete machine language
program. Very fast, but when the program fails,
difficult to show the programmer where are the
errors.
IMPLEMENT A LANGUAGE -
SCANNING
• Scanning process: a long string of characters is broken
into tokens.
• Example: sum = a + b is broken into 5 tokens sum, =, a,
+, b
• A token is the smallest meaningful unit of information.
IMPLEMENT A LANGUAGE -
PARSING
• Parsing: the string of tokens is transformed into a
syntactic structure.
• What happens in a compiler or interpreter is that the list
of tokens is converted to a parse tree in memory via a
complicated algorithm.
•=
•sum •+
•a •b
PARSING A COMPLICATED
EQUATION
PARSING A COMPLICATED
EQUATION
FORTRAN
• Procedural, imperative language
• Still used in scientific computation
• Developed at IBM in the 1950s by
John Backus (1924-2007)
• Backus’s 1977 Turing award lecture made the
case for functional programming
FORTRAN
“Anyone could learn Lisp in one day,
except that if they already knew
FORTRAN, it would take three days”
- Marvin Minsky
LEX THE LANGUAGE LAWYER
++x++
This is evaluated first
Now C++ …
class DoublePlus {
public:
// prefix operator
DoublePlus operator++() { … }
// postfix operator
DoublePlus operator++(int) { … }
};
Increments x,
returns old value
Can only be applied
to l-value
(more about this
later in the course)
Not an l-value! This is illegal in C!
What is this for?
MORE FUN WITH PREFIX AND
POSTFIX
x+=x++
+x = ++x
What do these mean?
C
• Bell Labs 1972 (Dennis Ritchie)
• Development closely related to UNIX
• 1983 Turing Award to Thompson and Ritchie
• Added weak typing to B
• int, char, their pointer types
• Typed arrays = typed pointers
• int a[10]; … x = a[i]; means
x = *(&a[0]+i*sizeof(int))
• Compiles to native code
C++
• Bell Labs 1979 (Bjarne Stroustrup)
• “C with Classes” (C++ since 1983)
• Influenced by Simula
• Originally translated into C using
Cfront, then native compilers
• Several PL concepts
• Multiple inheritance
• Templates / generics
JAVA
• Sun 1991-1995 (James Gosling)
• Originally called Oak,
intended for set top boxes
• Mixture of C and Modula-3
• Unlike C++
• No templates (generics), no multiple inheritance, no operator
overloading
• Like Modula-3 (developed at DEC SRC)
• Explicit interfaces, single inheritance, exception handling,
built-in threading model, references & automatic garbage
collection (no explicit pointers!)
WHY SO MANY
LANGUAGES?
“There will always be things we wish
to say in our programs that in all
languages can only be said poorly.”
- Alan Perlis
THANK YOU FOR LISTENING….

Contenu connexe

Similaire à LP1_educationeducationeducationeducation

Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
mustafkhalid
 
Computer, generations, languages, soft wares
Computer, generations, languages, soft waresComputer, generations, languages, soft wares
Computer, generations, languages, soft wares
kiranmohan42
 

Similaire à LP1_educationeducationeducationeducation (20)

مدخل برمجة صعيدي جيكس
مدخل برمجة صعيدي جيكس مدخل برمجة صعيدي جيكس
مدخل برمجة صعيدي جيكس
 
Plc part 1
Plc part 1Plc part 1
Plc part 1
 
Rustbridge
RustbridgeRustbridge
Rustbridge
 
C som-programmeringssprog-bt
C som-programmeringssprog-btC som-programmeringssprog-bt
C som-programmeringssprog-bt
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
History of programming
History of programmingHistory of programming
History of programming
 
Programming skills
Programming skillsProgramming skills
Programming skills
 
Synapseindia dot net development computer programming
Synapseindia dot net development  computer programmingSynapseindia dot net development  computer programming
Synapseindia dot net development computer programming
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
 
ProgrammingIntroduction.ppt
ProgrammingIntroduction.pptProgrammingIntroduction.ppt
ProgrammingIntroduction.ppt
 
Computer, generations, languages, soft wares
Computer, generations, languages, soft waresComputer, generations, languages, soft wares
Computer, generations, languages, soft wares
 
C++ programming languages lectures
C++ programming languages lectures C++ programming languages lectures
C++ programming languages lectures
 
CDA4411: Chapter 10 - Application Development
CDA4411: Chapter 10 - Application DevelopmentCDA4411: Chapter 10 - Application Development
CDA4411: Chapter 10 - Application Development
 
cpphtp4_PPT_01.ppt
cpphtp4_PPT_01.pptcpphtp4_PPT_01.ppt
cpphtp4_PPT_01.ppt
 
Chapter 04 C++ Programmings Fundamental.
Chapter 04 C++ Programmings Fundamental.Chapter 04 C++ Programmings Fundamental.
Chapter 04 C++ Programmings Fundamental.
 
Programming language
Programming languageProgramming language
Programming language
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
 
Mcs lec2
Mcs lec2Mcs lec2
Mcs lec2
 
1. intro to comp & c++ programming
1. intro to comp & c++ programming1. intro to comp & c++ programming
1. intro to comp & c++ programming
 

Dernier

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Dernier (20)

Benefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxBenefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptx
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 

LP1_educationeducationeducationeducation

  • 2. ALGORITHM • Abu Ja’far Muhammad ibn Musa al-Khorezmi (“from Khorezm”) • Lived in Baghdad around 780 – 850 AD • Chief mathematician in Khalif Al Mamun’s “House of Wisdom” • Author of “A Compact Introduction To Calculation Using Rules Of Completion And Reduction”
  • 3. “CALCULUS OF THOUGHT” • Gottfried Wilhelm Leibniz • 1646 - 1716 • Inventor of calculus and binary system • “Calculus ratiocinator”: human reasoning can be reduced to a formal symbolic language, in which all arguments would be settled by mechanical manipulation of logical concepts • Invented a mechanical calculator
  • 4. FORMALISMS FOR COMPUTATION • Predicate logic • Gottlöb Frege (1848-1925) • Formal basis for proof theory and automated theorem proving • Logic programming • Computation as logical deduction • Turing machines • Alan Turing (1912-1954) • Imperative programming • Sequences of commands, explicit state transitions, update via assignment
  • 5. FORMALISMS FOR COMPUTATION • Lambda calculus • Alonzo Church (1903-1995) • Formal basis for all functional languages, semantics, type theory • Functional programming Recursive functions & automata • Stephen Kleene (1909-1994) • Regular expressions, finite-state machines, PDAs
  • 6. CHURCH’S LEGACY Alonzo Church (PhD Princeton 1927) Hartley Rogers (PhD Princeton 1952) Albert Meyer (PhD Harvard 1972) Vitaly Shmatikov (PhD Stanford 2000) John Mitchell (PhD MIT 1984) … 1916 other academic descendants Recursion theory Semantics, concurrency Theory of object-oriented languages
  • 7. CHURCH’S THESIS • All these different syntactic formalisms describe the same class of mathematical objects • Church’s Thesis: “Every effectively calculable function (effectively decidable predicate) is general recursive” • Turing’s Thesis: “Every function which would be naturally regarded as computable is computable by a Turing machine” • Recursion, lambda-calculus and Turing machines are equivalent in their expressive power.
  • 8. FORMALISMS FOR COMPUTATION • Combinatory logic • Moses Schönfinkel (1889-1942??) • Haskell Curry (1900-1982) • Post production systems • Emil Post (1897-1954) • Markov algorithms • Andrey Markov (1903-1979)
  • 9. PROGRAMMING LANGUAGE • Formal notation for specifying computations • Syntax (usually specified by a context-free grammar) • Semantics for each syntactic construct • Translation vs. compilation vs. interpretation • C++ was originally translated into C by Stroustrup’s Cfront • Java originally used a bytecode interpreter, now native code compilers are commonly used for greater efficiency.
  • 10. THE BINARY MACHINE • A modern computer can run programs written in JavaScript, Pascal, Visual Basic, Visual C++, etc. • However, computers can only understand one language: the machine language it is not easy to use. • The machine language of a Sun workstation is different from a PC (or other platform), however, they can run the same C++ program.
  • 11. TWO TYPES OF TRANSLATORS • Interpreter: • translate and run the source code one line at a time. Easy to write and easy to find the errors in the program, but running very slow. • JavaScript, VBScript, PHP, … • Compiler: • translates the source code once and for all, producing a complete machine language program. Very fast, but when the program fails, difficult to show the programmer where are the errors.
  • 12. IMPLEMENT A LANGUAGE - SCANNING • Scanning process: a long string of characters is broken into tokens. • Example: sum = a + b is broken into 5 tokens sum, =, a, +, b • A token is the smallest meaningful unit of information.
  • 13. IMPLEMENT A LANGUAGE - PARSING • Parsing: the string of tokens is transformed into a syntactic structure. • What happens in a compiler or interpreter is that the list of tokens is converted to a parse tree in memory via a complicated algorithm. •= •sum •+ •a •b
  • 16. FORTRAN • Procedural, imperative language • Still used in scientific computation • Developed at IBM in the 1950s by John Backus (1924-2007) • Backus’s 1977 Turing award lecture made the case for functional programming
  • 17.
  • 18. FORTRAN “Anyone could learn Lisp in one day, except that if they already knew FORTRAN, it would take three days” - Marvin Minsky
  • 19. LEX THE LANGUAGE LAWYER ++x++ This is evaluated first Now C++ … class DoublePlus { public: // prefix operator DoublePlus operator++() { … } // postfix operator DoublePlus operator++(int) { … } }; Increments x, returns old value Can only be applied to l-value (more about this later in the course) Not an l-value! This is illegal in C! What is this for?
  • 20. MORE FUN WITH PREFIX AND POSTFIX x+=x++ +x = ++x What do these mean?
  • 21. C • Bell Labs 1972 (Dennis Ritchie) • Development closely related to UNIX • 1983 Turing Award to Thompson and Ritchie • Added weak typing to B • int, char, their pointer types • Typed arrays = typed pointers • int a[10]; … x = a[i]; means x = *(&a[0]+i*sizeof(int)) • Compiles to native code
  • 22. C++ • Bell Labs 1979 (Bjarne Stroustrup) • “C with Classes” (C++ since 1983) • Influenced by Simula • Originally translated into C using Cfront, then native compilers • Several PL concepts • Multiple inheritance • Templates / generics
  • 23. JAVA • Sun 1991-1995 (James Gosling) • Originally called Oak, intended for set top boxes • Mixture of C and Modula-3 • Unlike C++ • No templates (generics), no multiple inheritance, no operator overloading • Like Modula-3 (developed at DEC SRC) • Explicit interfaces, single inheritance, exception handling, built-in threading model, references & automatic garbage collection (no explicit pointers!)
  • 24. WHY SO MANY LANGUAGES? “There will always be things we wish to say in our programs that in all languages can only be said poorly.” - Alan Perlis
  • 25. THANK YOU FOR LISTENING….