CS代考 COMP 302: Programming Languages and Paradigms

Week 0: Welcome! Prof. Xujie Si
COMP 302: Programming Languages and Paradigms

Are you ready for the 2022 Winter semester?

Copyright By PowCoder代写 加微信 powcoder

The Magical Powers of (Functional) Programming
Prior to COMP 302 Start of COMP 302 End of COMP 302

COMP 302: Overview

COMP 302: Overview
Thorough introduction to the foundations and paradigms of programming languages.

COMP 302: Overview
Theme Prerequisite
Thorough introduction to the foundations and paradigms of programming languages.
COMP 250 Recommended MATH 240 or COMP 230

COMP 302: Overview
Theme Prerequisite
Evaluation
Thorough introduction to the foundations and paradigms of programming languages.
COMP 250 Recommended MATH 240 or COMP 230
• 4%: attendance (expected to attend ≥ 20 lectures/tutorials)
• 46%: 5 homework (HW1: 6%, HW2-5: 10%)
• 17%: midterm exam (online)
• 33%: final exam (in-person)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

COMP 302: Overview (cont.)
New concepts (Tuesdays)
• MyCourses: schedule, announcements, homework, grades, etc.
• LearnOCaml: https://winter2022-comp302.cs.mcgill.ca
• Ed: online discussions, question answering
• Lecture link: https://mcgill.zoom.us/j/85776807659
• Office hour link: https://mcgill.zoom.us/j/88322140523
• Mentoring hour link: https://mcgill.zoom.us/j/89264595369
• Google Calendar: https://shorturl.at/crzJ6
• (Optional) Discord: https://discord.gg/u5KGPSVd8r
Tutorials (Thursdays)

Dynamic and Interactive learning environment

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What we will do …
• Provide a set of notes for all topics covered in class (pdf)
• Provide LearnOCaml: Web-based programming platform for OCaml with autograder
• Provide code examples discussed in lectures in “Playground” on LearnOCaml for you to interact and play with the code
• Live coding lecture on Tuesday
• Tutorials on Thursday
• Weekly mentoring and office hours

Dynamic and Interactive learning environment
What you should do … • Read notes
• Play with code in “playground” on LearnOCaml
• Attend live lectures on Tuesday
• Participate in tutorials on Thursday
• Ask for help/suggestions during mentoring/office hours • Post questions on Ed
• Answer questions on Ed

Got a question?

Got a question?
• What to do? Post your question and answer questions on Ed • You get quicker reply
• Other students profit from the answer as well
• Good use of tags on questions (see if others asked it already)
• What not to do?
• Post snippets of your own code
• Ask for answers to HWs or exams …

Got a question?
• What to do? Post your question and answer questions on Ed • You get quicker reply
• Other students profit from the answer as well
• Good use of tags on questions (see if others asked it already)
• What not to do?
• Post snippets of your own code
• Ask for answers to HWs or exams …

Got a question?
• What to do? Post your question and answer questions on Ed • You get quicker reply
• Other students profit from the answer as well
• Good use of tags on questions (see if others asked it already)
• What not to do?
• Post snippets of your own code
• Ask for answers to HWs or exams …

Instructor – Xujie Si
Short Bio: Prof. Xujie Si
– Studied CS at Nankai Univ. (China) and at . (US) – PhD at the University of Pennsylvania (US)
– Assistant Professor at McGill since 2021
Fun: reading, cooking, traveling, coding
Research I do:
program analysis, formal verification, neuro-symbolic reasoning, AI
Courses I teach:
– COMP 302: Programming Languages and Paradigms (Winter)
– COMP 597: Automated Reasoning with Machine Learning (Fall)

Teaching Assistant –
Short Bio: 1st year PhD studying AI and PL
Fun: Physics, travelling, cooking and gaming!
Why do you like COMP 302 / functional programming?
“Functional programming is an abstraction of mathematics to computing. It solves problems in an effective and elegant way.”

Teaching Assistant –
Short Bio: 1st year PhD studying programming languages Fun: Cooking and experiencing a wide range of cuisine Why do you like COMP 302 / functional programming?
Functional programming is a brilliant way to delegate your work to a computer. It helps you to focus on the main problem instead of secondary issues such as index range.

Teaching Assistant –
Short Bio: 1st year PhD studying programming languages
Fun: book-reading, board-gaming, Wikipedia-editing
Why do you like COMP 302 / functional programming?
“I love how it lets you write powerful programs in a concise and elegant way. It also forces you to think differently about programming!”

Teaching Assistant –
Short Bio: graduate student-teacher studying CS education
Hobbies: Gardening, playing music, playing Super Smash Bros (hit me up for some friendlies!)
Why do I like FP?
Thinking about types in my code helps me write simpler code, debug quicker, and structure what I write.

Teaching Assistant – Johanna Schwartzentruber
Short Bio: 2nd year MSc student studying programming languages
Fun: exploring the outdoors, and beating my friends and family at board games
“Coming from a math student, it’s the type of programming that makes the most sense.”

Teaching Assistant — Marc-
Short Bio: 1st year MSc student studying programming languages
Fun: Play video games, program side projects
Why do you like COMP 302 / functional programming?
“Learning about the fundamentals of programming languages makes it easier to learn new programming languages.
Higher-order functions, modules and monads, which allow for flexible programs, loosely coupled components and expressive contracts respectively.”

Teaching Assistant –
Short Bio: 1st MSc student studying data science and NLP Fun: Swimming, hiking, cooking
What’s the coolest thing about FP?
Higher-order functions open a new world to programming and provide a new aspect of solving problems.

TEAM Mentors
Angelina Duan
, , , Zhongjie Wu,

The four main goals of COMP 302

The four main goals of COMP 302
Provide a thorough introduction to fundamental concepts in
programming languages
• Higher-order functions
• Stateful vs state-free computation • Modeling objects and closures
• Exceptions to defer control
• Continuations to defer control
• Polymorphism
• Partial evaluation
• Lazy programming
• Type systems, type inference, etc.

The four main goals of COMP 302
Provide a thorough introduction to fundamental concepts in
programming languages
• Higher-order functions
• Stateful vs state-free computation • Modeling objects and closures
• Exceptions to defer control
• Continuations to defer control
• Polymorphism
• Partial evaluation
• Lazy programming
• Type systems, type inference, etc.

The four main goals of COMP 302
Provide a thorough introduction to fundamental concepts in
programming languages
• Higher-order functions
• Stateful vs state-free computation • Modeling objects and closures
• Exceptions to defer control
• Continuations to defer control
• Polymorphism
• Partial evaluation
• Lazy programming
• Type systems, type inference, etc.
After this, any new programming languages in the future will be quite familiar to you!

The four main goals of COMP 302
1. 2. 3. 4.
Provide a thorough introduction to fundamental concepts in programming languages
Show different ways to reason about programs
• Type checking, Induction, Operational semantics, …
Introduce fundamental principles in programming language design
• Grammars and parsing, type checking, polymorphism, and subtyping
Expose students to a different way of thinking about problems
• It’s like going to the gym; it’s good for you!

The four main goals of COMP 302
1. 2. 3. 4.
Provide a thorough introduction to fundamental concepts in programming languages
Show different ways to reason about programs
• Type checking, Induction, Operational semantics, …
Introduce fundamental principles in programming language design
• Grammars and parsing, type checking, polymorphism, and subtyping
Expose students to a different way of thinking about problems
• It’s like going to the gym; it’s good for you!

The four main goals of COMP 302
1. 2. 3. 4.
Provide a thorough introduction to fundamental concepts in programming languages
Show different ways to reason about programs
• Type checking, Induction, Operational semantics, …
Introduce fundamental principles in programming language design
• Grammars and parsing, type checking, polymorphism, and subtyping
Expose students to a different way of thinking about problems
• It’s like going to the gym; it’s good for you!

The four main goals of COMP 302
1. 2. 3. 4.
Provide a thorough introduction to fundamental concepts in programming languages
Show different ways to reason about programs
• Type checking, Induction, Operational semantics, …
Introduce fundamental principles in programming language design
• Grammars and parsing, type checking, polymorphism, and subtyping
Expose students to a different way of thinking about problems
• It’s like going to the gym; it’s good for you!

What’s the future of programming?
What’s the future of programming?
“If you want to see which features will be in mainstream programming languages
“If you want to see which features will in mainstream tomorrow, then take a look at functional
programming languages, then take a look at functional programming languages today.”
programming languages today.” “Languages like [..] OCaml have served as
“Languages like […] OCaml have served as a laboratory for
neawlaidbeoarsatorbyefodrevnelwopiedde,asomtoeboef wdehvicehlotphedn, made the
transition into the mainstream.”
some of which have then made the transition into the mainstream.”
— Jones
(Principal Researcher at Microsoft)
(Principal Researcher at Microsoft)
Check out the article: “What’s the future of programming? The answer lies in
What is the future of programming? — The answer lies in functional languages
functional languages” at www.techrepublic.com

Guiding Principle 1
“A language that doesn’t affect the way you think about programming, is not worth knowing.” –
First Turing Award Winner
Prof. at Purdue, University, and Yale
Worked on programming languages and compilers (in particular Algol)
Perlis, A. J. “Epigrams on programming”. ACM SIGPLAN Notices. 17 (9): 7-13, 1982
http://www.cs.yale.edu/homes/perlis-alan/quotes.html

Guiding Principle 2
“Simple, elegant solutions are more effective, but they are harder to find than complex ones, and they require more time, which we too often believe to be unaffordable.”
– (Turing Award 1984)

Why do I need to know this?

Why do I need to know this?
• Science and art of programming
• Skills you learn will help you become a better programmer
• More productive, more systematic thinking, code is easier to maintain and read, etc.
• Useful in some upper-level courses
• Software engineering, systems, machine learning, deep learning (?!)
• Many job opportunities

Why do I need to know this?
• Science and art of programming
• Skills you learn will help you become a better programmer
• More productive, more systematic thinking, code is easier to maintain and read, etc.
• Useful in some upper-level courses
• Software engineering, systems, machine learning, deep learning (?!)
• Many job opportunities

Why do I need to know this?
• Science and art of programming
• Skills you learn will help you become a better programmer
• More productive, more systematic thinking, code is easier to maintain and read, etc.
• Useful in some upper-level courses
• Software engineering, systems, machine learning, deep learning (?!)
• Many job opportunities

Why do I need to know this?
• Science and art of programming
• Skills you learn will help you become a better programmer
• More productive, more systematic thinking, code is easier to maintain and read, etc.
• Useful in some upper-level courses
• Software engineering, systems, machine learning, deep learning (?!)
• Many job opportunities

Why do I need to know this?
• Science and art of programming
• Skills you learn will help you become a better programmer
• More productive, more systematic thinking, code is easier to maintain and read, etc.
• Useful in some upper-level courses
• Software engineering, systems, machine learning, deep learning (?!)
• Many job opportunities

General words of wisdom
What does a good student do?
— Type your suggestions into the chat —

General words of wisdom
What does a good student do?
— Type your suggestions into the chat —

Academic Integrity
• All work submitted must represent your own efforts.
• Assignments can be tested online and you can try as many times as
• Copying solutions completely or partially is not allowed
• Allowing others to copy your solutions is not acceptable. • You are responsible of protecting your work.
• Make sure your code are not public (e.g., GitHub public repo)
• We will be running MOSS, a plagiarism detection software, that looks for code similarities as well as conducting manual code review.

Academic Integrity
Let’s practice.

Scenario – 1
Alice and Bob have formed a study group to discuss the lecture material. At one of their meet-ups, they start talking about question 2 of the COMP 302 homework.
They start sketching the idea on a shared screen. Alice wants to see if their ideas work. She fires up a browser, types up the solution in LearnOCaml. It works! She copies the solution to Bob and they happily split. A week

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com