SlideShare a Scribd company logo
1 of 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….

More Related Content

Similar to LP1_educationeducationeducationeducation

مدخل برمجة صعيدي جيكس
مدخل برمجة صعيدي جيكس مدخل برمجة صعيدي جيكس
مدخل برمجة صعيدي جيكس Hesham Hanafi
 
Rustbridge
RustbridgeRustbridge
Rustbridgekent marete
 
History of programming
History of programmingHistory of programming
History of programmingSharwin Calimlim
 
Programming skills
Programming skillsProgramming skills
Programming skillsCOMMON Europe
 
Synapseindia dot net development computer programming
Synapseindia dot net development  computer programmingSynapseindia dot net development  computer programming
Synapseindia dot net development computer programmingSynapseindiappsdevelopment
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langaugemustafkhalid
 
ProgrammingIntroduction.ppt
ProgrammingIntroduction.pptProgrammingIntroduction.ppt
ProgrammingIntroduction.pptJoel Manio
 
Computer, generations, languages, soft wares
Computer, generations, languages, soft waresComputer, generations, languages, soft wares
Computer, generations, languages, soft wareskiranmohan42
 
C++ programming languages lectures
C++ programming languages lectures C++ programming languages lectures
C++ programming languages lectures jabirMemon
 
CDA4411: Chapter 10 - Application Development
CDA4411: Chapter 10 - Application DevelopmentCDA4411: Chapter 10 - Application Development
CDA4411: Chapter 10 - Application DevelopmentFreddy San
 
cpphtp4_PPT_01.ppt
cpphtp4_PPT_01.pptcpphtp4_PPT_01.ppt
cpphtp4_PPT_01.pptSuleman Khan
 
Chapter 04 C++ Programmings Fundamental.
Chapter 04 C++ Programmings Fundamental.Chapter 04 C++ Programmings Fundamental.
Chapter 04 C++ Programmings Fundamental.YasirAli288
 
Programming language
Programming languageProgramming language
Programming languageMakku-Sama
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++farooq2016
 
Mcs lec2
Mcs lec2Mcs lec2
Mcs lec2Faiza Gull
 

Similar to 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
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1
 

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….