Principles of Programming Jacques Carette McMaster University Week - - PowerPoint PPT Presentation

principles of programming jacques carette
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Principles of Programming Jacques Carette

McMaster University

Week of September 7, 2016

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

(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

slide-9
SLIDE 9

(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

slide-10
SLIDE 10

(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

slide-11
SLIDE 11

(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

slide-12
SLIDE 12

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