Principles of Programming Jacques Carette McMaster University Week - - PowerPoint PPT Presentation
Principles of Programming Jacques Carette McMaster University Week - - PowerPoint PPT Presentation
Principles of Programming Jacques Carette McMaster University Week of September 7, 2016 Algorithms and Programs Old: > 2500 years Babylonians: arithmetic, compound interest, compute length of hypothenuse of right triangle. J.Carette
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
J.Carette (McMaster) CS/SE 2S03 2 / 1
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
New: automation. < 300 years.
◮ Jacquard Loom, Basille Bouchon’s loom, Babbage’s Difference Engine,
punched cards.
J.Carette (McMaster) CS/SE 2S03 2 / 1
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
New: automation. < 300 years.
◮ Jacquard Loom, Basille Bouchon’s loom, Babbage’s Difference Engine,
punched cards.
Problem: encoding the algorithm.
J.Carette (McMaster) CS/SE 2S03 2 / 1
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
New: automation. < 300 years.
◮ Jacquard Loom, Basille Bouchon’s loom, Babbage’s Difference Engine,
punched cards.
Problem: encoding the algorithm.
◮ First step: what the hardware can do ⋆ ILLIAC computer, see its instruction set (ex: p.75 of the Manual). J.Carette (McMaster) CS/SE 2S03 2 / 1
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
New: automation. < 300 years.
◮ Jacquard Loom, Basille Bouchon’s loom, Babbage’s Difference Engine,
punched cards.
Problem: encoding the algorithm.
◮ First step: what the hardware can do ⋆ ILLIAC computer, see its instruction set (ex: p.75 of the Manual). ◮ Second: stored program ⋆ Stored program, Von Neumann architecture J.Carette (McMaster) CS/SE 2S03 2 / 1
Algorithms and Programs
Old: > 2500 years
◮ Babylonians: arithmetic, compound interest, compute length of
hypothenuse of right triangle.
New: automation. < 300 years.
◮ Jacquard Loom, Basille Bouchon’s loom, Babbage’s Difference Engine,
punched cards.
Problem: encoding the algorithm.
◮ First step: what the hardware can do ⋆ ILLIAC computer, see its instruction set (ex: p.75 of the Manual). ◮ Second: stored program ⋆ Stored program, Von Neumann architecture ◮ Third: think of humans a little... ⋆ Fortran was a step forward, but it still had a 3-way branch. ⋆ but things are still bad J.Carette (McMaster) CS/SE 2S03 2 / 1
(Programming) Languages
Formal Languages. Syntax and Semantics.
◮ Wikipedia gives a silly definition using strings. Refers to Frege’s
Begriffsschrift as an example, but that language is 2-dimensional!
◮ Syntax: Markdown, HTML, official Java grammar ◮ Semantics: operational (how to run), denotational (what it means, using
math)
J.Carette (McMaster) CS/SE 2S03 3 / 1
(Programming) Languages
Formal Languages. Syntax and Semantics.
◮ Wikipedia gives a silly definition using strings. Refers to Frege’s
Begriffsschrift as an example, but that language is 2-dimensional!
◮ Syntax: Markdown, HTML, official Java grammar ◮ Semantics: operational (how to run), denotational (what it means, using
math)
Programming Languages
◮ There are a lot of them. Some are truly bizarre. See Piet. ◮ APL was weird, but almost mainstream. Too dense. ◮ Genealogy and Influence (and more Influence). J.Carette (McMaster) CS/SE 2S03 3 / 1
(Programming) Languages
Formal Languages. Syntax and Semantics.
◮ Wikipedia gives a silly definition using strings. Refers to Frege’s
Begriffsschrift as an example, but that language is 2-dimensional!
◮ Syntax: Markdown, HTML, official Java grammar ◮ Semantics: operational (how to run), denotational (what it means, using
math)
Programming Languages
◮ There are a lot of them. Some are truly bizarre. See Piet. ◮ APL was weird, but almost mainstream. Too dense. ◮ Genealogy and Influence (and more Influence). ◮ Why Java? ⋆ Popularity? ⋆ Ecosystem? ⋆ JCP? ⋆ It is statically typed as well as decently designed? J.Carette (McMaster) CS/SE 2S03 3 / 1
(Programming) Languages
Formal Languages. Syntax and Semantics.
◮ Wikipedia gives a silly definition using strings. Refers to Frege’s
Begriffsschrift as an example, but that language is 2-dimensional!
◮ Syntax: Markdown, HTML, official Java grammar ◮ Semantics: operational (how to run), denotational (what it means, using
math)
Programming Languages
◮ There are a lot of them. Some are truly bizarre. See Piet. ◮ APL was weird, but almost mainstream. Too dense. ◮ Genealogy and Influence (and more Influence). ◮ Why Java? ⋆ Popularity? ⋆ Ecosystem? ⋆ JCP? ⋆ It is statically typed as well as decently designed? ⋆ All, of course! J.Carette (McMaster) CS/SE 2S03 3 / 1
What is a Programming Language?
Has a grammar which can be checked Is executable Is a medium of communication: Human ⇐ ⇒ Program ⇐ ⇒ Machine
J.Carette (McMaster) CS/SE 2S03 4 / 1