Bryn Mawr College
CMSC 245 Principles of Programming Languages
Fall 2020
Course Materials
Prof. Deepak Kumar
General Information
Instructor(s)
Deepak Kumar
202 Park Science Building
526-7485
dkumar at brynmawr dot edu
https://cs.brynmawr.edu/~dkumar/
Lecture Hours: Mondays & Thursdays from 9:40a to 11:00a
Office Hours: Thursdays from 11:10 to 12:30p via Zoom. Meeting ID: 973 0477 6657 (ask me for password)
Lecture Room: Room 300 Park Science Building (Tentative) This is remote-only class.
Lab: All Labs will be remote.
Thursdays from 11:10a to 12:30p in Rooms 230 and 231 Park Science Building
Note: FIRST LAB MEETING WILL BE IN WEEK#2
Laboratories
- Computer Science Lab Rooms 230 & 231 (Science Building)
- You may also be able to use your own computer to do labs for this course.
Texts & Software
Main Text (Required): Programming Language Pragmatics (Fourth Edition) by Michael Scott. Morgan-Kaufmann 2015. Available in Campus Bookstore, or purchase online from Amazon.com (Price on August 19, 2020 is $56.79 for e-text, $68.55 paperback).
Software: We will use several programming language compilers/interpreters in this course. Some of them will be installed on our Linux servers accessible through Lab computers. You are also welcome to install these on your own computers as the need arises. Other than language compilers, we will be using these tools: Visual Studio Code (VS Code), Piazza, Zoom. |
|
Class Piazza: Click here to go to class Piazza.
Syllabus
Course Description: An introduction to the study of programming languages. Where do programming languages come from and how do they evolve? And why should a programmer choose one over another? This course explores these topics by covering several different programming language features and paradigms, including object-oriented, functional, and dynamic. It also looks at the history and future of programming languages by studying the active development of several real-world languages. Students will explore several programming languages by writing code in those languages. Prerequisite: CMSC B206 or H106 or H107 and CMSC B231 Spaces 20; [Note: These limits have changed for in-person classes and are dictated by allotted classroom spaces.]
Topics
- Language implementation models: Compilers and interpreters
- Names, Scopes, and Bindings
- Control Flow: Sequencing, selection, repetition, recursion
- Data Types: Type systems, type checking, structures, arrays, strings, pointers, lists, files
- Control Abstraction: subroutines/functions, parameter passing, exception handling, coroutines, events
- Data Abstraction: objects, object-oriented programming
Important Dates
August 31: |
Week 0 Session |
September 10: |
First class meeting |
October 8: |
Exam 1 |
November 12: |
Exam 2 |
December 10: |
Exam 3 [This may change] |
Creating a Welcoming Environment
All members of the Instruction Staff are dedicated to the cause of improving diversity, equity, and inclusion in the field of computing, and to supporting the wellness and mental health of our students.
Diversity and Inclusion
It is essential that all members of the course community – the instructor, TAs, and students – work together to create a supportive, inclusive environment that welcomes all students, regardless of their race, ethnicity, gender identity, sexuality, or socioeconomic status. All participants in this course deserve to and should expect to be treated with respect by other members of the community.
Class meetings, lab sessions, office hours, and group working time should be spaces where everyone feels welcome and included. In order to foster a welcoming environment, students of this course are expected to: exercise consideration and respect in their speech and actions; attempt collaboration and consideration, including listening to opposing perspectives and authentically and respectfully raising concerns, before conflict; refrain from demeaning, discriminatory, or harassing behavior and speech.
Wellness
Additionally, your mental health and wellness are of utmost importance to the course Instruction Staff, if not the College as a whole. All members of the instruction staff will be happy to chat or just to listen if you need someone to talk to, even if it’s not specifically about this course.
If you or someone you know is in distress and urgently needs to speak with someone, please do not hesitate to contact BMC Counseling Serices: 610-526-7360 (610-526-7778 nights and weekends). If you are uncomfortable reaching out to Counseling Services, any member of the Instruction Staff will be happy to contact them on your behalf.
We understand that student life can be extremely difficult, both mentally and emotionally. If you are living with mental health issues such as anxiety, depression, ADHD, or other conditions that may affect you this semester, you are encouraged to discuss these with the Instructor. Although the details are up to you to disclose, the Instruction Staff will do their best to support and accommodate you in order to ensure that you can succeed this course while staying healthy.
Assignments
- Assignment#1: (Due in Dropbox before start of class on Monday, September 14): Chapter 1 of Scott lists several programming languages. Can you count them and list them? What is your favorite programming language that you know? Why? Write up a short essay/note (1-2 pages) containing your "count", answers to these questions, comments on the readings. Hand in a printed version at the start of class on September 14.
- Assignment#2: (Due in Dropbox before start of class on Monday, September 21): Write a short (1-page) summary of the programming language assigned to you. You will make a 2-minute presentation on this to the class on Monday, September 21. Each group can designate a speaker for this one. The 1-page summary should be the result of work by all members of the group. Please use the scheduled Lab time (or a time outside of that) to get together for discuss the language. Others in the group will do subsequent presentations.
- Assignment#3 (Due in Dropbox before start of class on Monday, October 26): Write a report that summarizes the built-in types, variables, and control structures in the programming language assigned to you. This should be the result of work by all members of the group. Please use the scheduled Lab time (or a time outside of that) to get together for discuss the language. Each group should designate a new presenter for this one. Only ONE person should do the presentation.
- Assignment#4 (This is for self-study. Not required to submit anything.): It is included on the last page of Lab#4.
- Assignment#5 (Due in Dropbox before start of class on Thursday, December 3): Write a final report summarizing the programming language assigned to you. Build on the previous presentations. Focus on subroutines and parameter passing, exception handling, and data abstraction.
- etc.
Lectures
- Week 0
(August 31)
September 3: Course Overview for Virtual Shopping Week and Schedule Adjustment purposes. The meeting will run from 9:40a to 11:00a on Zoom (Meeting info will be e-mailed to you).
- Week 1 (September 8, 10)
September 8: Labor Day Holiday. No class.
September 10: First class meeting. Course Introduction.
Class Notes: Click here.
Read: Section 1.1 from Scott. Also, How do we tell truths that might hurt? by E. W. Dijkstra. And, The Semicolon Wars by Brian Hayes.
Assignment#1: (Due in Dropbox before start of class on Monday, September 14): Chapter 1 of Scott lists several programming languages. Can you count them and list them? What is your favorite programming language that you know? Why? Write up a short essay/note (1-2 pages) containing your "count", answers to these questions, comments on the readings. Hand in a printed version at the start of class on September 14.
- Week 2 (September 14, 17)
September 14: Discussion on Hayes and Dijkstra articles. The programming language spectrum: low-level vs high-level. Key paradigms: imperative (von neumann, object-oriented, scriptiong, etc.), declarative (functional, logic, etc.), other paradigms. Top programming languages today. The TIOBE Index of Programming Languages.
Read: Sections 1.1 through 1.5 from Scott.
DO: Please think of 2-3 programming languages you would like to learn as a part of this course. By the end of Thursday's class I want to form groups and assign a programming language to each group. Here are some programming languages to choose from: C++, C#, Swift, Ruby, Haskell, SML, Julia, Lisp, Prolog, (or consult with me brfore hand).
Class Notes: Click here.
September 17: Assigning Groups & programming Languages. Programming language implementations: compilers, interpreters, intermediate language virtual machines.
Class Notes: Click here.
Assignment#2: (Due in Dropbox before start of class on Monday, September 21): Write a short (1-page) summary of the programming language assigned to you. You will make a 2-minute presentation on this to the class on Monday, September 21. Each group can designate a speaker for this one. The 1-page summary should be the result of work by all members of the group. Please use the scheduled Lab time (or a time outside of that) to get together to discuss the language. Others in the group will do subsequent presentations.
- Week 3 (September 21, 24)
September 21: Presentations on programming languages: C# (Sarah, Elly, Keijing, Ziyao), Go (Deepak), Haskell (Caroline, Trang, Vy), Javascript (Anna, Haiqa, Al, Ashley), Lisp (Maya, Haley, Adrian), Rust (Lily, Jacob), Swift (Linh, Tino, Judy). Looking at the compilation process using gcc/g++ etc. Elements of programming languages. An overview of the concepts and terminology associated with the design decisions underlying programming languages: Bindings, binding time. Static allocation scheme.
Class Notes: Click here.
Read: Sections 3.1 and 3.2 from Scott.
September 24:
Static allocation, stack-based allocation, heap-based allocation.
Scope: static and dynamic scoping. Referencing environment.
Class Notes: Click here.
Read: Sections 3.3-3.5 from Scott.
Lab1 is posted: Click here. Please complete the lab by next class. Once completed, send a short email letting your instructor know.
- Week 4 (September 28, October 1)
September 28: Implementing static and dynamic scoping. Other binding-related concepts: aliasing, overloading, polymorphism.
[Apologies for the Zoom hiccup this morning. Luckily it was towards the end of class. I have reported the issue to Zoom.]
Class Notes: Click here.
Read: Skim remainder of Chapter 3 from Scott.
October 1:
Polymorphism, first-class values. Examples of functions as first-class values in Python and using map() and filter().
Anonymous functions: Lambda functions. Examples. Control Flow - Expressions. Expression component, operator precedence rules.
Class Notes: Click here.
Read: Start reading Section 6.1 from Scott.
Lab2 is posted. Click here. Please complete the lab by next class. You are required to fill out the Lab2 Form and submitted it in your shared dropbox folder by start of next class.
- Week 5 (October 5, 8)
October 5: Control Flow: Expressions and Assignments. operators, precedence rules, conditional operator (?:) in different languages. Assignment: l-values and r-values, value and reference models of variables, orthogonality. Boxing in Java. Statement expressions in C (and issues.
Read: Section 6.1 from Scott.
Class Notes: Click here.
October 8:
Exam 1 is today.
(Download here!) <--- link is live now.
The Exam will be as a PDF Form that will be posted at 9:00a Eastern Time today. The completed exam should be returned to the shared dropbox folder by 1:00p Eastern Time on October 8, 2020. Late submissions will not receive ANY credit.
The exam will be designed as an 80-minute exam. All resources are permitted, but no assistance from another person.
- Week 6 (October 12, 15)
October 12: Exam Solutions review. Implementing mutable and immutable types in Java.
Exam 1 solutions: Click here.
Class Notes: Click here.
Read: Chapter 6 for Thursday's class.
October 15:
Control Flow: Assignment, Conditional statements: Design issues. Examples.
Class Notes: Click here.
Read: Chapter 6 from Scott.
Lab 3: Click here. (Due on Thursday, October 22)
Assignment#3 (Due in Dropbox before start of class on Monday, October 26): Write a report that summarizes the built-in types, variables, and control structures in the programming language assigned to you. This should be the result of work by all members of the group. Please use the scheduled Lab time (or a time outside of that) to get together for discuss the language. Each group should designate a new presenter for this one. Only ONE person should do the presentation.
- Week 7 (October 19, 22)
October 19: Control Flow: Repetition. Loops. Examples. Anatomy of a loop. Design and PL issues. Iterators. Recursion. Iteration versus Recursion. Tail recursion.
Read: Sections 6.5 and 6.6 from Scott (Ignore implementation details).
Class Notes: Click here.
October 22:
Data Types & Type Systems. Predefined/Built-in types: Scalars - Numbers (integers, floats), characters, booleans, complex.
Read: Chapter 7 from Scott.
Class Notes: Click here.
- Week 8 (October 26, 29)
October 26: Presentations on programming languages: C# (Sarah, Elly, Keijing, Ziyao), Go (Deepak), Haskell (Caroline, Trang, Vy), Javascript (Anna, Haiqa, Al, Ashley), Lisp (Maya, Haley, Adrian), Rust (Lily, Jacob), Swift (Linh, Tino, Judy).
Read: Start reading Chapter 8 from Scott.
October 29:
Data Types: enumerated types, subrange types. Composite Types: Records/structures, arrays.
Class Notes: Click here.
- Week 9 (November 2, 5)
November 2: There will be no teaching in class today in support of the student strike. There will be a scheduled class meeting as a space for open conversation between students. Deepak will leave the meeting as soon as there are no more questions for him allowing you all to talk amongst yourselve freely. As of now, the class will resume with normal content on Thursday, November 5. More information will be forthcoming on Wednesday, November 4.
November 5: Opening class discussion.
Read: Section 7.2 and Chapter 8. Data Types not covered in class will be assigngned for optional self-study (please skim the section on sets, pointers, lists, and files).
- Week 10 (November 9, 12)
November 9: Data Types: Arrays: representation, 2-D arrays- row-major and column major form. Strings. Type compatibility, type checking, type equivalence, type coercion.
Class Notes: Click here.
Read: Chapter 9 from Scott.
November 12:
Exam 2 is today.
Type compatibility, type checking, type equivalence, type coercion. Subroutines & Control Abstraction: Stack frames, Parameter Passing.
Class Notes: Click here.
Lab#4 is posted. Click here. [This is for self-study. Not required to submit anything.]
Assignment#4 (This is for self-study. Not required to submit anything.): It is included on the last page of Lab#4.
Read: Chapter 9 from Scott.
- Week 11 (November 16, 19)
November 16: Parameter passing schemes: pass by value, result, value-result, reference, name. Parameter passing schemes in some common programming languages.
Class Notes: Click here.
Read: Chapter 9 from Scott.
November 19: Exception Handling. Exception handling in Java, Python, and Go.
Class Notes: Click here.
Read: Chapter 9 from Scott.
Assignment#5 (Due in Dropbox before start of class on Thursday, December 3): Write a final report summarizing the programming language assigned to you. Build on the previous presentations. Focus on subroutines and parameter passing, exception handling, and data abstraction.
- Week 12 (November 24, 27) No classes. Safe travels.
- Week 13 (November 30, December 3) - Remote
November 30: Data Abstraction and Object-orientation: Classes, generics, encapsulation and inheritance, initialization and finalization, other OOP issues.
Read: Chapter 10 from Scott (rely mostly on class notes!)
Class Notes: Click here.
Class recording: Click here.
December 3:
Language presentations: Final Reports - C#, Haskell.
Class Recording: Click here. (Note: Due to the hiccup at my end, I was unable to start recording until half way through the C# presentation. My apologies to the C# group. I will try and have my act together on Monday!)
Language Reports: C#,
Haskell, Javascript, Lisp (Presentation), Rust, Swift.
- Week 14 (December 7, 10) - Remote
December 7: Language presentations; Final reports - Javascript, Lisp, Rust, Swift.
Class recording: Click here.
- Topic: CMSC 245 Lecture
Start Time : Dec 7, 2020 09:31 AM
- Meeting Recording:
https://brynmawr-edu.zoom.us/rec/share/qF1UvMjbBwgMXkShymwG1pIQaF18vlpB5aNqVWM45SyE4XSL41vf2-dpi0ZEchVp.9IE88RSFgJlP41Q2
- Access Passcode: CMSC245-Fall2020
-
December 10: Exam 3 is today.
Course Policies
Communication
Attendance and active participation are expected in every class. Participation includes asking questions, contributing answers, proposing ideas, and providing constructive comments.
As you will discover, we are proponents of two-way communication and we welcome feedback during the semester about the course. We are available to answer student questions, listen to concerns, and talk about any course-related topic (or otherwise!). Come to office hours! This helps us get to know you. You are welcome to stop by and chat. There are many more exciting topics to talk about that we won't have time to cover in-class.
Although computer science work can be intense and solitary, please stay in touch with us, particularly if you feel stuck on a topic or project and can't figure out how to proceed. Often a quick e-mail, phone call or face-to-face conference can reveal solutions to problems and generate renewed creative and scholarly energy. It is essential that you begin assignments early, since we will be covering a variety of challenging topics in this course.
Grading
There will be 5-7 assignments (both written and in-class presentations), weighted equally in the final grading. Assignments must be submitted according to the Assignment Submission instructions.
All graded work will receive a grade: 4.0, 3.7, 3.3, 3.0, 2.7, 2.3, 2.0, 1.7,
1.3, 1.0, or 0.0. At the end of the semester, final grades will be calculated as a weighted average of all grades according to the following weights:
Eaxm 1: |
15% |
Eaxm 2: |
20% |
Exam 3 |
20% |
Assignments |
25% |
Labs |
10% |
Citizenship/Contribution |
10% |
Incomplete grades will be given only for verifiable medical illness or other such dire circumstances.
Submission and Late Policy
All work must be turned in electronically in your designated Dropbox Folder. We will set up this up in Week#1.
No assignment will be accepted after it is past due.
No past work can be "made up" after it is due.
No regrade requests will be entertained one week after the graded work is returned in class.
Any extensions will be given only in the case of verifiable medical excuses or other such dire circumstances, if requested in advance and supported by your Academic Dean.
Exams
There will be three exams in this course. The exams will be closed-book and closed-notes. The exams will cover material from lectures, homeworks, and assigned readings (including topics not discussed in class).
Study Groups
We encourage you to discuss the material and work together to understand it. Here are our thoughts on collaborating with other students:
- The readings and lecture topics are group work. Please discuss the readings and associated topics with each other. Work together to understand the material. We highly recommend forming a reading group to discuss the material -- we will explore many ideas and it helps to have multiple people working together to understand them.
- It is fine to discuss the topics covered in the homeworks, to discuss approaches to problems, and to sketch out general solutions. However, you MUST write up the homework answers, solutions, and programs individually without sharing specific solutions, mathematical results, program code, etc. If you made any notes or worked out something on a white board with another person while you were discussing the homework, you shouldn't use those notes while writing up your answer.
- Under ABSOLUTELY NO circumstances should you share computer code with another student. Similarly, you are not permitted to use or consult code found on the internet for any of your assignments.
- Exams, of course, must be your own individual work.
If you have any questions as to what types of collaborations are allowed, please feel free to ask.
Created on August 19, 2020.