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

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

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
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
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
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
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
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
 
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🔝
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.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
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

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