SlideShare uma empresa Scribd logo
1 de 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….

Mais conteúdo relacionado

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

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

Último

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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
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
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
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
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
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
 

Último (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🔝
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
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
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
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
 
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
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
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 🔝✔️✔️
 

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