Welcome & Introduction15150/resources/lectures/0/lecture0.pdf · Cameron Wong, Cooper Pierce, Emma...

Post on 19-Jun-2020

5 views 0 download

transcript

Lecture 0Principles of Functional Programming

Summer 2020

Welcome & IntroductionCourse Stuff, FunctionalProgramming, and the SMLEvaluation System

Section 1

Welcome to 150

Jacob Neumann Welcome & Introduction 18 May 2020 2 / 34

(Please pardon the amount of information on these slides)

Jacob Neumann Welcome & Introduction 18 May 2020 3 / 34

Who we are

Instructors

Jacob Neumann: Me! I’m finishing up my master’s degree in logic(in the CMU Philosophy Department). I’ve taught 15-150 six timesas a TA, most recently spring 2020.Dilsun Kaynar: Dilsun is an Assistant Teaching Professor in SCS.She will be delivering several lectures this semester.

TAs: Aditi Gupta, Agam Kumar, Avery Cowan, Brandon Wu,Cameron Wong, Cooper Pierce, Emma Cohron, Eshita Kar, EthanRosenthal, Eunice Chen, Harrison Grodin, Isabel Gan, JamesGallicchio, Kaz Zhou, Leah Restad, Len Huang, Lili Chang, MiaTang, Nikhita Subbiah, Rahjshiba Koanda, Siva Somayyajula,Soumil Mukherjee, Tim Ganger

(See the course website at cs.cmu.edu/~15150/ for pictures & contactinfo).

Jacob Neumann Welcome & Introduction 18 May 2020 4 / 34

Who we are

Instructors

Jacob Neumann: Me! I’m finishing up my master’s degree in logic(in the CMU Philosophy Department). I’ve taught 15-150 six timesas a TA, most recently spring 2020.

Dilsun Kaynar: Dilsun is an Assistant Teaching Professor in SCS.She will be delivering several lectures this semester.

TAs: Aditi Gupta, Agam Kumar, Avery Cowan, Brandon Wu,Cameron Wong, Cooper Pierce, Emma Cohron, Eshita Kar, EthanRosenthal, Eunice Chen, Harrison Grodin, Isabel Gan, JamesGallicchio, Kaz Zhou, Leah Restad, Len Huang, Lili Chang, MiaTang, Nikhita Subbiah, Rahjshiba Koanda, Siva Somayyajula,Soumil Mukherjee, Tim Ganger

(See the course website at cs.cmu.edu/~15150/ for pictures & contactinfo).

Jacob Neumann Welcome & Introduction 18 May 2020 4 / 34

Who we are

Instructors

Jacob Neumann: Me! I’m finishing up my master’s degree in logic(in the CMU Philosophy Department). I’ve taught 15-150 six timesas a TA, most recently spring 2020.Dilsun Kaynar: Dilsun is an Assistant Teaching Professor in SCS.She will be delivering several lectures this semester.

TAs: Aditi Gupta, Agam Kumar, Avery Cowan, Brandon Wu,Cameron Wong, Cooper Pierce, Emma Cohron, Eshita Kar, EthanRosenthal, Eunice Chen, Harrison Grodin, Isabel Gan, JamesGallicchio, Kaz Zhou, Leah Restad, Len Huang, Lili Chang, MiaTang, Nikhita Subbiah, Rahjshiba Koanda, Siva Somayyajula,Soumil Mukherjee, Tim Ganger

(See the course website at cs.cmu.edu/~15150/ for pictures & contactinfo).

Jacob Neumann Welcome & Introduction 18 May 2020 4 / 34

Who we are

Instructors

Jacob Neumann: Me! I’m finishing up my master’s degree in logic(in the CMU Philosophy Department). I’ve taught 15-150 six timesas a TA, most recently spring 2020.Dilsun Kaynar: Dilsun is an Assistant Teaching Professor in SCS.She will be delivering several lectures this semester.

TAs: Aditi Gupta, Agam Kumar, Avery Cowan, Brandon Wu,Cameron Wong, Cooper Pierce, Emma Cohron, Eshita Kar, EthanRosenthal, Eunice Chen, Harrison Grodin, Isabel Gan, JamesGallicchio, Kaz Zhou, Leah Restad, Len Huang, Lili Chang, MiaTang, Nikhita Subbiah, Rahjshiba Koanda, Siva Somayyajula,Soumil Mukherjee, Tim Ganger

(See the course website at cs.cmu.edu/~15150/ for pictures & contactinfo).

Jacob Neumann Welcome & Introduction 18 May 2020 4 / 34

Who we are

Instructors

Jacob Neumann: Me! I’m finishing up my master’s degree in logic(in the CMU Philosophy Department). I’ve taught 15-150 six timesas a TA, most recently spring 2020.Dilsun Kaynar: Dilsun is an Assistant Teaching Professor in SCS.She will be delivering several lectures this semester.

TAs: Aditi Gupta, Agam Kumar, Avery Cowan, Brandon Wu,Cameron Wong, Cooper Pierce, Emma Cohron, Eshita Kar, EthanRosenthal, Eunice Chen, Harrison Grodin, Isabel Gan, JamesGallicchio, Kaz Zhou, Leah Restad, Len Huang, Lili Chang, MiaTang, Nikhita Subbiah, Rahjshiba Koanda, Siva Somayyajula,Soumil Mukherjee, Tim Ganger

(See the course website at cs.cmu.edu/~15150/ for pictures & contactinfo).

Jacob Neumann Welcome & Introduction 18 May 2020 4 / 34

The task before us

Cover a full semester’s worth of content,in 6 weeks,

completely remotely

This will require lots of persistence, diligence, and hard work!

Jacob Neumann Welcome & Introduction 18 May 2020 5 / 34

The task before us

Cover a full semester’s worth of content

,in 6 weeks,

completely remotely

This will require lots of persistence, diligence, and hard work!

Jacob Neumann Welcome & Introduction 18 May 2020 5 / 34

The task before us

Cover a full semester’s worth of content,in 6 weeks

,completely remotely

This will require lots of persistence, diligence, and hard work!

Jacob Neumann Welcome & Introduction 18 May 2020 5 / 34

The task before us

Cover a full semester’s worth of content,in 6 weeks,

completely remotely

This will require lots of persistence, diligence, and hard work!

Jacob Neumann Welcome & Introduction 18 May 2020 5 / 34

The task before us

Cover a full semester’s worth of content,in 6 weeks,

completely remotely

This will require lots of persistence, diligence, and hard work!

Jacob Neumann Welcome & Introduction 18 May 2020 5 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Course Structure

Lecture

Introduce concepts and techniquesDemonstrate how to solve problems

Lab

Review lecture contentShow more worked examples (lab solutions posted afterwards)Give you hands-on experience solving problems (with your peers)

Homework

Give you extensive experience with contentAssess how well you understand how to solve problems (on your own)Usually focused on one topic

Quizzes

Test how well you internalized & deeply understood materialProvide a “check” for you (and us) to continually gauge your progress

Final

Evaluate how well you understood the material overall

Jacob Neumann Welcome & Introduction 18 May 2020 6 / 34

Synchronicity

“Officially”, this course is offered on Pittsburgh time and you areexpected to attend every course meeting live

,

but we’re doing our best to make this course as accessible as possible:

Lectures will be recorded, and the recordings made available,

In addition to the official 9am-10:20am EDT lab time, we will offerlabs at 12pm-1:20pm EDT and some time late at night EDT (i.e.daytime in Asia & the Pacific),

In addition to afternoon/evening office hours, we will offer someoffice hours very late at night and/or very early in the morning(EDT).

Jacob Neumann Welcome & Introduction 18 May 2020 7 / 34

Synchronicity

“Officially”, this course is offered on Pittsburgh time and you areexpected to attend every course meeting live,

but we’re doing our best to make this course as accessible as possible

:

Lectures will be recorded, and the recordings made available,

In addition to the official 9am-10:20am EDT lab time, we will offerlabs at 12pm-1:20pm EDT and some time late at night EDT (i.e.daytime in Asia & the Pacific),

In addition to afternoon/evening office hours, we will offer someoffice hours very late at night and/or very early in the morning(EDT).

Jacob Neumann Welcome & Introduction 18 May 2020 7 / 34

Synchronicity

“Officially”, this course is offered on Pittsburgh time and you areexpected to attend every course meeting live,

but we’re doing our best to make this course as accessible as possible:

Lectures will be recorded, and the recordings made available

,

In addition to the official 9am-10:20am EDT lab time, we will offerlabs at 12pm-1:20pm EDT and some time late at night EDT (i.e.daytime in Asia & the Pacific),

In addition to afternoon/evening office hours, we will offer someoffice hours very late at night and/or very early in the morning(EDT).

Jacob Neumann Welcome & Introduction 18 May 2020 7 / 34

Synchronicity

“Officially”, this course is offered on Pittsburgh time and you areexpected to attend every course meeting live,

but we’re doing our best to make this course as accessible as possible:

Lectures will be recorded, and the recordings made available,

In addition to the official 9am-10:20am EDT lab time, we will offerlabs at 12pm-1:20pm EDT and some time late at night EDT (i.e.daytime in Asia & the Pacific)

,

In addition to afternoon/evening office hours, we will offer someoffice hours very late at night and/or very early in the morning(EDT).

Jacob Neumann Welcome & Introduction 18 May 2020 7 / 34

Synchronicity

“Officially”, this course is offered on Pittsburgh time and you areexpected to attend every course meeting live,

but we’re doing our best to make this course as accessible as possible:

Lectures will be recorded, and the recordings made available,

In addition to the official 9am-10:20am EDT lab time, we will offerlabs at 12pm-1:20pm EDT and some time late at night EDT (i.e.daytime in Asia & the Pacific),

In addition to afternoon/evening office hours, we will offer someoffice hours very late at night and/or very early in the morning(EDT).

Jacob Neumann Welcome & Introduction 18 May 2020 7 / 34

Don’t complete course activities “asynchronously”if you do not have to

Jacob Neumann Welcome & Introduction 18 May 2020 8 / 34

Grades

Your semester grade will be based on the following:

35% – Homeworks (9)

25% – Quizzes (5)

10% – Lab Attendance (12)

05% – Lecture Attendance (28)

25% – Final Exam (1)

See the course website (url below) for the schedule of when these takeplace.

The university is not doing the same Pass/Fail option from the Spring.We will determine the grade letter boundaries based on a review ofeveryone’s work and achievements in the course (and we’ll do our best tobe fair); we will not be releasing information on grade cutoffs – don’task!

Jacob Neumann Welcome & Introduction 18 May 2020 9 / 34

Grades

Your semester grade will be based on the following:

35% – Homeworks (9)

25% – Quizzes (5)

10% – Lab Attendance (12)

05% – Lecture Attendance (28)

25% – Final Exam (1)

See the course website (url below) for the schedule of when these takeplace.

The university is not doing the same Pass/Fail option from the Spring.

We will determine the grade letter boundaries based on a review ofeveryone’s work and achievements in the course (and we’ll do our best tobe fair); we will not be releasing information on grade cutoffs – don’task!

Jacob Neumann Welcome & Introduction 18 May 2020 9 / 34

Grades

Your semester grade will be based on the following:

35% – Homeworks (9)

25% – Quizzes (5)

10% – Lab Attendance (12)

05% – Lecture Attendance (28)

25% – Final Exam (1)

See the course website (url below) for the schedule of when these takeplace.

The university is not doing the same Pass/Fail option from the Spring.We will determine the grade letter boundaries based on a review ofeveryone’s work and achievements in the course (and we’ll do our best tobe fair); we will not be releasing information on grade cutoffs – don’task!

Jacob Neumann Welcome & Introduction 18 May 2020 9 / 34

How to earn your grades: Homework

When the HW is released, SSH into andrew, and use 150m20 todownload the homework (details below)

Complete the homework, producing a tarfile with your codesolutions and a pdf file with your (typeset) written solutions.

Submit each to the appropriate Gradescope assignment before thedeadline.

Jacob Neumann Welcome & Introduction 18 May 2020 10 / 34

How to earn your grades: Homework

When the HW is released, SSH into andrew, and use 150m20 todownload the homework (details below)

Complete the homework, producing a tarfile with your codesolutions and a pdf file with your (typeset) written solutions.

Submit each to the appropriate Gradescope assignment before thedeadline.Jacob Neumann Welcome & Introduction 18 May 2020 10 / 34

How to earn your grades: Homework

For the code, there is a script which will do some basic checks onyour submission (it does not grade your code). You’re highlyencouraged to submit early and often, and make sure yoursubmission passes this script.

There are no late days this semester. All due dates are final, barringexceptional circumstances.

Jacob Neumann Welcome & Introduction 18 May 2020 11 / 34

How to earn your grades: Homework

For the code, there is a script which will do some basic checks onyour submission (it does not grade your code). You’re highlyencouraged to submit early and often, and make sure yoursubmission passes this script.

There are no late days this semester. All due dates are final, barringexceptional circumstances.

Jacob Neumann Welcome & Introduction 18 May 2020 11 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you. If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought. Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you. If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought. Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you.

If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought. Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you. If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought. Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you. If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought.

Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Attendance

Lecture

1 Attend lecture

I will post the link to a form where you can submit attendance if you’rewatching the lecture recorded instead of live (“asynchronously attend”).Some work will be required of you. If you anticipate needing to attendmore than a few lectures asynchronously, you must coordinate that withme.

Lab

1 Attend lab

2 Solve the question with your group

3 Submit your answer (as a group) to the corresponding Gradescopeassignment

You’ll receive full points for any answer that shows effort and thought. Ifyou cannot attend lab, please use the “Adjustments form” (detailedbelow) to indicate this, and you’ll be able to make that lab up.

Jacob Neumann Welcome & Introduction 18 May 2020 12 / 34

How to earn your grades: Quizzes & Final

Quizzes

1 During the allotted time, go to the Gradescope assignment

2 Complete the quiz

Quizzes will happen during your lab time, and will cover whatevercontent was covered on homeworks since the last quiz. The quizzes willbe designed to take you 30 or 40 minutes, but you’ll have twice thatmuch time to complete them.

Final: Likely to be similar to Quizzes, except longer and covering theentire course. Details TBA as we get closer.

Jacob Neumann Welcome & Introduction 18 May 2020 13 / 34

How to earn your grades: Quizzes & Final

Quizzes

1 During the allotted time, go to the Gradescope assignment

2 Complete the quiz

Quizzes will happen during your lab time, and will cover whatevercontent was covered on homeworks since the last quiz. The quizzes willbe designed to take you 30 or 40 minutes, but you’ll have twice thatmuch time to complete them.

Final: Likely to be similar to Quizzes, except longer and covering theentire course. Details TBA as we get closer.

Jacob Neumann Welcome & Introduction 18 May 2020 13 / 34

How to earn your grades: Quizzes & Final

Quizzes

1 During the allotted time, go to the Gradescope assignment

2 Complete the quiz

Quizzes will happen during your lab time, and will cover whatevercontent was covered on homeworks since the last quiz.

The quizzes willbe designed to take you 30 or 40 minutes, but you’ll have twice thatmuch time to complete them.

Final: Likely to be similar to Quizzes, except longer and covering theentire course. Details TBA as we get closer.

Jacob Neumann Welcome & Introduction 18 May 2020 13 / 34

How to earn your grades: Quizzes & Final

Quizzes

1 During the allotted time, go to the Gradescope assignment

2 Complete the quiz

Quizzes will happen during your lab time, and will cover whatevercontent was covered on homeworks since the last quiz. The quizzes willbe designed to take you 30 or 40 minutes, but you’ll have twice thatmuch time to complete them.

Final: Likely to be similar to Quizzes, except longer and covering theentire course. Details TBA as we get closer.

Jacob Neumann Welcome & Introduction 18 May 2020 13 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrow

If executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrowIf executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrowIf executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrowIf executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrowIf executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

The 150 m20 script

Note: Infrastructure office hours during lab times tomorrowIf executed from somewhere within the private directory of your afsspace,

150 m20 lecture 4

downloads the lecture number 4 code/notes.

150 m20 homework basics

downloads the basics homework handout.

150 m20 lab datatypes

downloads the datatypes lab handout.

150 m20 lab -sol induction

downloads the induction lab solutions.

Jacob Neumann Welcome & Introduction 18 May 2020 14 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything.

Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Adjustments Form

I’ll post a link to a Google form, which you should fill out in order to:

Request permission to submit lab attendance late (must besubmitted before lab, or else you won’t receive credit)

Request to be moved to a different lab time

Arrange to complete lecture attendance asynchronously

Other administrative stuff, as it comes up

I’ll try to check the form daily, and contact you I need to follow up onanything. Before emailing us or posting to Piazza, kindly make sure thatyour issue isn’t directly addressed by some option on the form.

Jacob Neumann Welcome & Introduction 18 May 2020 15 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website

150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

Lecture recordings

Will be posted on Canvas

Lecture notes & code

Will be posted on website150m20 lecture <lectNum >

Lab solutions

150m20 lab -sol <labName >

Piazza

piazza.com/cmu/summer2020/15150/home

Office hours

Details will be posted on Piazza/Canvas

The 150 course website

cs.cmu.edu/~15150/

Jacob Neumann Welcome & Introduction 18 May 2020 16 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsiteAnything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsiteAnything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsiteAnything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsite

Anything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsiteAnything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.

Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Resources available to you

The sml help website (in development)

smlhelp.github.io

Gradescope

gradescope.com/courses/115308

Includes “Regrade Request” feature, where you can request the TAtake another look & provide you more detailed explanation forgrading

Talk to us!

Post privately on Piazza, or find our contact details on the coursewebsiteAnything related to academic integrity, privacy, semester grades,accommodations, etc. should be directed to Professors. Anythingrelated to grading (i.e. your grade on a particular assignment), officehours, clarifications on homework problems, lab-related stuff, etc.should be direct to the TAs.Get to know your TAs!

Jacob Neumann Welcome & Introduction 18 May 2020 17 / 34

Our expectations for you

It is very important you do the following.

Abide by the university’s policies on academic integrity, as well asthe policies listed at cs.cmu.edu/~15150/policy.html

Read the policy on the website!You will be tested on your understanding of these policies in the firsthomeworkWe do catch people cheating. The consequences are harsh. Don’trisk it.

Attend regularly & participate

Your TAs work extremely hard to deliver this course. Show them duerespect by participating.Participating over zoom will be awkward & more difficult. Do yourbest.

Jacob Neumann Welcome & Introduction 18 May 2020 18 / 34

Our expectations for you

It is very important you do the following.

Abide by the university’s policies on academic integrity, as well asthe policies listed at cs.cmu.edu/~15150/policy.html

Read the policy on the website!You will be tested on your understanding of these policies in the firsthomework

We do catch people cheating. The consequences are harsh. Don’trisk it.

Attend regularly & participate

Your TAs work extremely hard to deliver this course. Show them duerespect by participating.Participating over zoom will be awkward & more difficult. Do yourbest.

Jacob Neumann Welcome & Introduction 18 May 2020 18 / 34

Our expectations for you

It is very important you do the following.

Abide by the university’s policies on academic integrity, as well asthe policies listed at cs.cmu.edu/~15150/policy.html

Read the policy on the website!You will be tested on your understanding of these policies in the firsthomeworkWe do catch people cheating. The consequences are harsh. Don’trisk it.

Attend regularly & participate

Your TAs work extremely hard to deliver this course. Show them duerespect by participating.Participating over zoom will be awkward & more difficult. Do yourbest.

Jacob Neumann Welcome & Introduction 18 May 2020 18 / 34

Our expectations for you

It is very important you do the following.

Abide by the university’s policies on academic integrity, as well asthe policies listed at cs.cmu.edu/~15150/policy.html

Read the policy on the website!You will be tested on your understanding of these policies in the firsthomeworkWe do catch people cheating. The consequences are harsh. Don’trisk it.

Attend regularly & participate

Your TAs work extremely hard to deliver this course. Show them duerespect by participating.

Participating over zoom will be awkward & more difficult. Do yourbest.

Jacob Neumann Welcome & Introduction 18 May 2020 18 / 34

Our expectations for you

It is very important you do the following.

Abide by the university’s policies on academic integrity, as well asthe policies listed at cs.cmu.edu/~15150/policy.html

Read the policy on the website!You will be tested on your understanding of these policies in the firsthomeworkWe do catch people cheating. The consequences are harsh. Don’trisk it.

Attend regularly & participate

Your TAs work extremely hard to deliver this course. Show them duerespect by participating.Participating over zoom will be awkward & more difficult. Do yourbest.

Jacob Neumann Welcome & Introduction 18 May 2020 18 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.

Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.

Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to lab

If you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!

If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!

If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!

If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Communicate!

Important: If your ability to complete the course is at all affected byfactors outside your control (e.g. you or someone close to youbecomes seriously ill, you begin to have significant issues withinternet/technology access, etc.), please let us know immediately.Important: If you anticipate missing more than one or two coursemeetings (lecture or lab) in a given week, please email me and let meknow what the circumstances are. Avoid this if at all possible –falling behind is much easier to do in the summer.Fill out the “Adjustments” form (and let your lab TAs know) aheadof time if you can’t make it to labIf you are having trouble with anything or need help, let us know!If you’re feeling worn out or lost or frustrated, let us know!If you’re feeling excited or engaged or inspired, let us know!If there’s things we could be doing to make the course better, let usknow!

Jacob Neumann Welcome & Introduction 18 May 2020 19 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat well

Exercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permit

Don’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hard

Be patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyone

Do as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.

Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

Our expectations for you

It is very important you do the following.

Take care

Sleep well and eat wellExercise as much as your circumstances permitDon’t push yourself too hardBe patient with yourself & others – this is a challenge for everyoneDo as much as you can to engage with friends, family, community,etc.Have fun!

Jacob Neumann Welcome & Introduction 18 May 2020 20 / 34

pause for questions

Jacob Neumann Welcome & Introduction 18 May 2020 21 / 34

Section 2

Functional Computation

Jacob Neumann Welcome & Introduction 18 May 2020 22 / 34

What do we use computers for?

Jacob Neumann Welcome & Introduction 18 May 2020 23 / 34

We’re interested in two particular answers:

To cause an effect

To calculate a value

Jacob Neumann Welcome & Introduction 18 May 2020 24 / 34

We’re interested in two particular answers:

To cause an effect

To calculate a value

Jacob Neumann Welcome & Introduction 18 May 2020 24 / 34

We’re interested in two particular answers:

To cause an effect

To calculate a value

Jacob Neumann Welcome & Introduction 18 May 2020 24 / 34

A lot of what we do is causing effects on computers

Jacob Neumann Welcome & Introduction 18 May 2020 25 / 34

Calculating values is a bit different

Jacob Neumann Welcome & Introduction 18 May 2020 26 / 34

Imperative programming

One of the main ideas behind what we call “Imperative Programming” isto calculate values by accumulating effects0.0

def exp ( n ) :i =0r e s =1whi le i<n :

r e s = r e s ∗ 2i = i + 1

return r e s

This works.

Jacob Neumann Welcome & Introduction 18 May 2020 27 / 34

Imperative programming

One of the main ideas behind what we call “Imperative Programming” isto calculate values by accumulating effects0.0

def exp ( n ) :i =0r e s =1whi le i<n :

r e s = r e s ∗ 2i = i + 1

return r e s

This works.

Jacob Neumann Welcome & Introduction 18 May 2020 27 / 34

Problem: DESTRUCTION

0.1

def max( L ) :r e s =0whi le len ( L)>0:

c u r r e n t = L . pop ( )i f ( c u r r e n t >r e s ) :

r e s=c u r r e n treturn r e s

This does not work. The operation pop() is destructive: it changes L,rather than merely looking at it. So when we execute max(L) once, Lis destroyed and subsequent calls won’t work.

Jacob Neumann Welcome & Introduction 18 May 2020 28 / 34

Problem: DESTRUCTION

0.1

def max( L ) :r e s =0whi le len ( L)>0:

c u r r e n t = L . pop ( )i f ( c u r r e n t >r e s ) :

r e s=c u r r e n treturn r e s

This does not work. The operation pop() is destructive: it changes L,rather than merely looking at it. So when we execute max(L) once, Lis destroyed and subsequent calls won’t work.

Jacob Neumann Welcome & Introduction 18 May 2020 28 / 34

Contrived example, but...

This demonstrates a key point:

Imperative programs can easily be wrong if you don’t keep trackof effects

If your program utilizes effects to calculate values, then you have to keeptrack of what state the computer’s in, because that might either:

Affect what value the program outputs

Change when the program is executed

This is one of the main topics taught in 15-122: how to keep track ofstates & effects.

Jacob Neumann Welcome & Introduction 18 May 2020 29 / 34

Contrived example, but...

This demonstrates a key point:

Imperative programs can easily be wrong if you don’t keep trackof effects

If your program utilizes effects to calculate values, then you have to keeptrack of what state the computer’s in, because that might either:

Affect what value the program outputs

Change when the program is executed

This is one of the main topics taught in 15-122: how to keep track ofstates & effects.

Jacob Neumann Welcome & Introduction 18 May 2020 29 / 34

Contrived example, but...

This demonstrates a key point:

Imperative programs can easily be wrong if you don’t keep trackof effects

If your program utilizes effects to calculate values, then you have to keeptrack of what state the computer’s in, because that might either:

Affect what value the program outputs

Change when the program is executed

This is one of the main topics taught in 15-122: how to keep track ofstates & effects.

Jacob Neumann Welcome & Introduction 18 May 2020 29 / 34

A Radical Proposal

Program without effects

Jacob Neumann Welcome & Introduction 18 May 2020 30 / 34

A Radical Proposal

Program without effects

Jacob Neumann Welcome & Introduction 18 May 2020 30 / 34

What this entails

We’ll need to

Figure out what computation means if not accumulating effects onsome state

See if we can implement all the functions we want in this newparadigm

See what advantages or disadvantages this programming stylecomes with (compared to imperative programming)

Jacob Neumann Welcome & Introduction 18 May 2020 31 / 34

What this entails

We’ll need to

Figure out what computation means if not accumulating effects onsome state

See if we can implement all the functions we want in this newparadigm

See what advantages or disadvantages this programming stylecomes with (compared to imperative programming)

Jacob Neumann Welcome & Introduction 18 May 2020 31 / 34

What this entails

We’ll need to

Figure out what computation means if not accumulating effects onsome state

See if we can implement all the functions we want in this newparadigm

See what advantages or disadvantages this programming stylecomes with (compared to imperative programming)

Jacob Neumann Welcome & Introduction 18 May 2020 31 / 34

What this entails

We’ll need to

Figure out what computation means if not accumulating effects onsome state

See if we can implement all the functions we want in this newparadigm

See what advantages or disadvantages this programming stylecomes with (compared to imperative programming)

Jacob Neumann Welcome & Introduction 18 May 2020 31 / 34

This has a name...

This style of programming is called FUNCTIONAL PROGRAMMING.

Jacob Neumann Welcome & Introduction 18 May 2020 32 / 34

This has a name...

This style of programming is called FUNCTIONAL PROGRAMMING.

Jacob Neumann Welcome & Introduction 18 May 2020 32 / 34

Broad Overview

The goal of this semester is to teach you functional programming.

We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview

The goal of this semester is to teach you functional programming. We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview

The goal of this semester is to teach you functional programming. We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview

The goal of this semester is to teach you functional programming. We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview

The goal of this semester is to teach you functional programming. We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview

The goal of this semester is to teach you functional programming. We’llcover:

How functional computation basically works (today and tomorrow)

How to write powerful code in a functional language, and how tomathematically reason about functional code (later this week, andnext week)

How to write highly-abstract functional programs which can beinstantiated to perform a variety of tasks (June 01 - 03)

How to use functional programming to design elegant control-flowalgorithms (June 04 - 09)

Jacob Neumann Welcome & Introduction 18 May 2020 33 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)Imperative code in functional code (June 19)Infinite data structures (June 22)Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)

Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)Imperative code in functional code (June 19)Infinite data structures (June 22)Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)

Imperative code in functional code (June 19)Infinite data structures (June 22)Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)Imperative code in functional code (June 19)

Infinite data structures (June 22)Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)Imperative code in functional code (June 19)Infinite data structures (June 22)

Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34

Broad Overview (continued)

How to design large pieces of software in a functional language(June 10 - 12)

Various cool things which functional programming makepossible/cleaner/easier/more elegant:

A kind of super-multitasking called parallelism which FP makestractable (June 15 & 16)Basic AIs that can intelligently play tic-tac-toe, checkers, and othergames (June 17 & 18)Imperative code in functional code (June 19)Infinite data structures (June 22)Other stuff (June 23 & 24)

Jacob Neumann Welcome & Introduction 18 May 2020 34 / 34