CS 251 Fall 2019
Principles of Programming Languages1

What is CS 251?

CS 251 examines principles in the design and implementation of programming languages.

Goals

This course aims to prepare you to:

  • Leverage powerful programming language features in languages that support them.
  • Quickly and effectively learn and evaluate new programming languages by focusing on key language dimensions.
  • Identify the model of computation underlying a programming language and recognize whether a given programming language is a good fit for a given problem.
  • Reason rigorously about the execution of programs using precisely defined models.
  • Understand key aspects of metaprogramming and programming language implementation approaches.
  • Implement a well-specified model by applying lessons from language design to construct a program, library, API, domain-specific language, or programming language.
  • Approach problem-solving through the lens of language design / program analysis.
  • Develop and apply skills for independent learning, critical thinking, and problem-solving as a self-reliant computer scientist.

Topics

We explore programming languages in 4 parts, with the theme of metaprogramming – specifying and implementing programming language features with other programs – appearing throughout the course. The course home page hosts the working schedule. Expect adjustments in the schedule from time to time.

  1. How to Program
    • syntax, dynamic semantics, and their meta-languages
    • expressions, bindings, and the environment model
    • pairs, lists, and GC
    • local bindings and scope
    • first-class and higher-order functions
    • lexical scope and function closures
    • tail recursion
    • immutability and referential transparency
  2. What’s in a Type
    • static types
    • datatypes and pattern-matching
    • parametric polymorphism (generic types)
    • currying and partial application
    • restricted mutable state
    • abstract types
    • type inference
    • static vs. dynamic typing
  3. When Things Happen
    • evaluation order, lambda calculus, and the substitution model
    • continuations
    • delayed evaluation and laziness
    • parallelism
    • concurrency
  4. Why a Broader PL Mindset
    • problem decomposition in functional vs. object-oriented programming
    • deductive programming
    • program analysis
    • domain-specific languages
    • approaching problems as a language designer / program analyst

When Should You Take CS 251?

Prerequisite: CS 230 is required to enroll in CS 251. We assume extensive familiarity with data structures, comfort with basic big-O analysis, familiarity with recursion, and general maturity in programming.

Recommendations:

  • Take CS 251 fairly close to when you take CS 240, but not at the same time. You will draw interesting connections between them. CS 240 and CS 251 both have heavier applied workloads, though, so they can be tough to balance in one semester. CS 240 and CS 251 each pair better with one of CS 231 or CS 235, which are both heavy on proof-style work. If you are looking to take 2 core courses at once, pairing one build-it course with one prove-it course is a good plan.
  • Take CS 251 in your sophomore or junior year. You will level up your programming and problem-solving skills for other courses, interviews, etc.

Please talk to the instructors if you have any questions or concerns or if you are considering credit/non grading. We are happy to work with you to make your time in CS 251 most effective and rewarding for you.

Logistics

The CS 251 Fall 2019 website and email list carry schedule, materials, and timely announcements.

Class Meetings

  • Tuesday/Friday 14:10 - 15:25, SCI E111, Ben Wood

Please silence and stow phones out of sight during class meetings. Taking handwritten notes in class tends to help distill and remember key ideas more effectively than referring back to prepared material or typed notes. If you feel strongly that a laptop or tablet works better for your notetaking, you may use it for that purpose. We may sometimes plan computer-based activities in class. We are happy to help arrange alternative accommodations in class if needed.

Staff and Hours

You may contact all staff (instructors and tutors) at once by emailing cs251f19-staff@wellesley.edu. Contact individual staff by their @wellesley.edu address below.

Regular hours are listed in this table. Temporary changes will be announced on the course email list and noted in the drop-in hours Google calendar, but not this table.

Name Contact Locale ? Drop-in Hours (gcal, .ics)
Class Instructor Ben Wood benjamin.wood SCI E114 (office), L037/L140 (drop-in hours) Monday 3:00-4:30pm SCI L140, Tuesday 4:15-5:30pm SCI L037, Friday 3:30-4:30pm SCI L037, or by appointment
Tutors Ruanqianqian (Lisa) Huang, Emma Shumadine email list SCI L037 CS Systems Lab Sunday 4:00-6:00pm, Monday 8:30-10:30pm, Tuesday 7:00-8:00pm, Thursday 8:00-9:00pm
Classmates CS 251 Fall 2019 email list SCI L037 CS Systems Lab, around campus by appointment

Course Materials

All course materials and assignments are linked from the calendar on the course website.

Acknowledgments

This course draws (with permission) on materials from previous versions of CS 251 at Wellesley by Lyn Turbak, Ben Wood, and Randy Shull, as well as materials by Dan Grossman at the University of Washington and Steve Freund at Williams College. Some parts of the Honor Code guidelines are adapted from the Williams College Computer Science Department Honor Code Guidelines. The late policy is based on ideas from Ada Lerner.

Course Work

topic pencil code exam

Course work for CS 251 consists of reading and class exercises, assignments, and exams. The Honor Code applies to CS 251 course work as defined below.

Reading and class exercises: Each topic on the course schedule includes reading to try before class and review after class. Class meetings and group exercises assume cursory familiarity with basic ideas from assigned readings, but not deep understanding. Effective technical reading is an acquired skill. The first reading assignment includes tips on how to read.

Assignments: The heart of CS 251 is a series of pencil code assignments that apply programming languages concepts. A working solution is just the start of completing an assignment. Style and clear explanations are major components of assignment assessment. Expect to invest significant weekly effort on assignments, including discovering and learning extensions to the ideas presented in class.

Exams: One in-class and one standard self-scheduled final exam are marked on the course schedule.

  1. exam The in-class exam covers the first two parts of the course.
  2. exam The self-scheduled final exam covers all topics from the course, with a focus on the latter parts.

Exams assess your individual mastery of key concepts. On multiple concepts, you will get multiple chances to demonstrate that you have mastered them.

Grades

Percentage Letter
> 95.0 A
≥ 90.0 ≥ A-
> 86.6 ≥ B+
> 83.3 ≥ B
≥ 80.0 ≥ B-
> 76.6 ≥ C+
> 73.3 ≥ C
≥ 70.0 ≥ C-
≥ 60.0 ≥ D
< 60.0 F

Assignments comprise 60% of your course grade. This component is calculated by dividing the sum of all awarded points by the sum of all available points. This weights each assignment according to its labeled point value.

Exams comprise 40% of your course grade. Exams will employ some “light” mastery grading2: the exam component of your course grade will not be a simple sum, mean, or weighting of your two exam grades. Rather, the exam component of your course grade will be calculated from your best performance in each of multiple concept categories. Categories for some key course concepts will be covered by both exams; other categories will appear on only one exam. This gives you two exam opportunities to demonstrate mastery of important concepts. For example, if you did not master a key concept on the in-class exam, the final exam gives you a second chance to demonstrate mastery of that concept. Whichever exam result on that concept is better is the result that will be reflected in your overall exam grade. We will define categories and mechanisms in more detail later in the semester, closer to exam time.

Course grade percentages are converted to letters as shown in the accompanying table. The minimum percentage required to achieve a given letter grade may be adjusted universally (across all students) downward (only to students’ benefit), but never upward or individually. If your percentage grade satisfies the constraint in the left column, then your letter grade will satisfy the constraint in the right column of the same row. Each student’s percentage grade is calculated independently without consideration of other students’ grades. Percentage grades are converted to a letter by applying the same universal mapping for all students.

Recall that the minimum grade to earn credit under credit/no credit grading is C. The minimum grade to pass and earn credit under normal letter grading is D. Notice that, by the grading table, this is a large gap: the minimum grade to achieve CR on the credit/non basis is more than 13 percentage points – a full 1/3 of the range of all passing grades – higher than the minimum grade to pass under letter grading. For comparison, that is the same distance between the minimum C+ grade and the minimum A- grade. For this reason, we advise that you not elect credit/non grading if you are concerned about potential poor performance in the course. Better to pass this time than to receive no credit retake the course.

Anonymous Grading

CS 251 makes a best effort to grade assignments and exams anonymously, meaning that, under normal circumstances, no student’s identity is associated with submitted work until all submissions for that assignment/exam have been graded in full. Once anonymous grading of all submissions for assignment or exam is complete, each student is identified and the unadjusted results are attached to the student’s record.

Anonymous grading helps us improve consistency and fairness, reduce any effects of implicit bias, and make clear that the course staff is grading your work, not you. To assist in maintaining anonymity, it is important to avoid listing your name within your work except where specified.

Limitations: The anonymity is “best effort” in that we can reveal the student identity associated with any submission at any time, but it is inconvenient to do so and we avoid it under normal circumstances. We try to detect submission problems early, before grading begins, so that they can be resolved without affecting anonymity. Nonetheless, anonymity can be compromised in cases where we discover a submission problem only later during grading and request that you resubmit, or when you submit late work after we graded on-time submissions.

Late Policy

Assignment work is where the majority of your CS 251 learning will occur. Assignments are due at the date and time specified in the assignment manifest. Deadlines synchronize with class material and scheduled academic support (drop-in hours) to help ensure smooth forward progress in the course. It is always wisest to keep up with the schedule.

Sometimes, however, prioritizing completion of an assignment by the deadline may not be the right personal choice for you. To encourage you to learn from the assignments while also affording flexibility when it benefits your health and well-being, you may use either of the following mechanisms to submit late assignment work without penalty:

  1. Self-serve 48-hour late pass: You may delay any assignment deadline by 48 hours by submitting this late pass notification form before the original deadline. There is no need for any other communication in this case.
    • The form requires a brief summary of progress (e.g., “#1 done, #2 stuck, #3 started” or “not started”) and whether you anticipate seeking support (drop-in hours/appointment) for the assignment (yes/no).
    • If the 48-hour extended deadline falls during a break or weekend, it is automatically moved to the final day of that break or weekend.
  2. Custom extension: If you need to extend an assignment deadline more than 48 hours, or if you did not submit a late pass notification in time, you must email the instructor with an initial timeline and plan for when and how you will complete the assignment and report on progress.
    • We will adjust the plan together to make sure it is reasonable. I may ask you to prioritize current work first. If you need custom extensions on more than assignments, I may ask you to check in with your class dean to make sure you are getting the support you need managing your course load this semester.
    • You are never required to discuss details of your personal circumstances with me to receive an extension, although I am happy to lend an ear. If you choose to share, please note that my reporting duties prevent me from holding strict confidentiality in all cases.

The above extension mechanisms are subject to the following limitations:

  1. No extension may surpass the last day of Reading Period unless your class dean supports it. The purpose of this restriction is to ensure that you have adequate time to prepare for the self-scheduled exam in this course and your other courses.
  2. Feedback and grading for work submitted under an extension will be completed as time allows. This may take arbitrarily long, possibly past the end of classes and exams. The likelihood and likely magnitude of delay grow with the length of the extension.

Exams are not subject to extensions. The in-class exam date is fixed, as noted on the course schedule. Mark it on your calendar. Please arrange accommodations with me at least 3 days ahead of the scheduled in-class exam. If you are unable to make the exam time at the last minute due to an emergency, we can schedule a make-up exam with the support of your class dean or health services. This sets a common standard for all students and ensures you are getting the support you need for your emergency.

Honor Code

The Wellesley Honor Code applies to CS 251, including through CS 251-specific policies for acceptable resources (collaboration, assistance, and reference) in course work. The general spirit of these policies should not be surprising, but the details are key to boosting the quality of your learning and maintaining a fair and rigorous academic environment for you and your classmates.

In summary:

  • Ungraded practice activities support initial learning, so they are free of restrictions. topic
  • Graded synthesis assignments support deeper learning and independence, so they require that your submitted work be your own. These assignments require you to think critically and make connections to formulate logic and implement solutions independently, so they restrict acceptable resources significantly. pencil code
  • Graded examinations measure your independent mastery of concepts, so they require that your submitted work be your own, without using any resources. exam

Full definitions are linked from the summary and appear below. Please read the entire policy. If in doubt about details, please ask for clarification. Violations of these policies are handled through the appropriate Honor Code charge or resolution processes.

Ungraded Practice Activities topic

Types: reading, study, class exercises

Policy: You may collaborate, receive and provide assistance, and consult reference without restriction.

Graded Synthesis Assignments pencil code

Types: written pencil assignments, applied code assignments

Policy:

  • A team works as one to complete and submit one assignment solution. A team is an individual or a pair, determined by the assignment’s designated team policy.
  • Your team’s submitted solutions must be your team’s own work.
  • You must not divide work among people (within or across teams) to complete separate parts and combine the solutions.
  • Your submissions must cite all collaboration, assistance, and reference (excluding course materials and reference linked from the course website) that your team used to prepare your submission. List each person or resource with a short phrase identifying the topic or nature of collaboration, assistance, or reference.

  • Collaboration:
    • You may discuss high-level ideas or strategies with other teams in small groups.
    • You must not communicate detailed algorithms, implementations, code, formulae, or other detailed solution steps with other teams.
    • You must not, under any circumstances, view, share, prepare, or accept written solutions or assignment code outside your team.
  • Assistance:
    • You may accept help from course staff to locate errors, interpret error messages, and correct errors of syntax.
    • You may accept help from other CS 251 Fall 2019 students to interpret error messages, subject to the above policy on viewing code.
  • Reference:
    • You may consult course material from CS 251 Fall 2019 and external documentation of required tools.
    • You may consult external reference resources for general concepts and techniques, provided you cite them.
    • You must not consult solutions to this or any similar assignment.
    • Code reuse and adaptation:
      • You may reuse and adapt provided starter code in your solution without restriction.
      • You may reuse and adapt code from other course materials only with prior written approval from the instructor and explicit attribution of the source.
      • You must not reuse or adapt any other code.

Rules of thumb for collaborating outside your team on graded synthesis assignments:

You are welcome to discuss high-level ideas and strategies with other teams, as allowed by the policy above. If taking notes on these discussions, keep your notes general (no verbatim copies, photographs, detailed descriptions). Remember, you may not write solutions together, so later, write full solutions on your own, referring to your notes only if needed.

  • Wait at least 30 minutes after discussions outside your team before writing your solutions. This helps you know whether you actually understand the solutions (and their derivation) yourself.
  • If writing your solution is effectively making a verbatim copy of – or following a set of explicit directions in – your notes from discussion with others, then your notes or your discussion are too detailed.

After the semester:

Some students students may wish to include work from CS 251 in portfolios, resumes, etc. Please do not post code publicly (including on GitHub, GitLab, Bitbucket, your own website, etc.), but feel free to show your code privately to potential employers or others who are not students. Do not make your code accessible or viewable by current or future CS 251 students.

Team Policy

Each graded assignment follows one of two team policies. Graded synthesis assignments indicate their policy in the assignment manifest.

  • The individual policy requires individual students to prepare and submit their own solutions.
  • The pair policy allows two students to prepare and submit a single joint solution.
    • Individuals may opt to complete an individual submission on pair assignments unless pairs are explicitly required.
    • Partners choosing a pair submission must contribute in similar measure and complete at least 80% of work on each problem together in real-time pair-programming style. Collaboration within a pair is otherwise unrestricted.
    • If it becomes necessary to split a pair, the partners must coordinate with the instructor to document what work was completed together.

Graded Examinations exam

Types: in-class exams, self-scheduled exams

Policy:

  • Your submitted solutions must be your own work.
  • You must not provide or use any collaboration, assistance, or reference external to the exam document between receiving and submitting the exam unless explicitly stated by the exam document itself.
  • You must not communicate about the exam contents with anyone other than the CS 251 Fall 2019 instructors until given permission by a CS 251 Fall 2019 instructor.

Academic Support

There are several types of academic support available outside of regular class and lab meetings:

  • Regular drop-in hours with tutors support questions on concepts and assignments.
  • Regular drop-in hours or scheduled appointments with instructors support questions on assignments, concepts, course logistics, random chats, or anything else. (Email or catch us after class to schedule an appointment outside drop-in hours.)
  • Questions, studying, or group work with your classmates, subject to the honor code.
  • Individual tutoring through the PLTC.

We ask you questions. The CS 251 staff genuinely enjoys helping you learn, whether in class or 1-on-1, especially when we can help you learn independently. We often answer your questions by asking you more questions to help you construct your own path forward. While this may feel less expedient in the short term, we find it more effective (and expedient) in the long term, since you learn a broader thought process rather than just an answer to one question.

Preparation is your ticket to assistance. In general, we expect you to make a genuine effort to answer your own question before asking for help on an assignment. It is rarely wise to spend hours stumped on a single issue before asking for help, but at least a few minutes of common sense exploration often nets effective results or at least helps focus your question. Error message? Try looking it up in the assignment, associated tool documentation, or a web search to understand the error. Crashing program? Try to employ debugging strategies and tools listed in the assignment to make progress toward understanding the cause.

Feedback

The instructors are always open to considering your comments, suggestions, or concerns about the course or how we can make it more accessible to you. Please be in touch.

Accommodations

If you have a disability or condition, either long-term or temporary, and need reasonable academic adjustments in this course, please contact Accessibility and Disability Resources (ADR) to get a letter outlining your accommodation needs, and submit that letter to me. You should request accommodations as early as possible in the semester, or before the semester begins, since some situations can require significant time for review and accommodation design. If you need immediate accommodations, please arrange to meet with me as soon as possible. If you are unsure but suspect you may have an undocumented need for accommodations, you are encouraged to contact (ADR). They can provide assistance including screening and referral for assessments.

Acessibility and Disability Services can be reached at accessibility@wellesley.edu, at 781-283-2434, by scheduling an appointment online at their website, or by visiting their offices on the 3rd floor of Clapp Library, rooms 316 and 315.

Students whose religious observances conflict with scheduled course events (e.g., exams) should contact the instructor in advance to discuss alternative arrangements. You may do this through the new Wellesley College Religious Observance Notification system if you prefer.

How to Succeed

A compilation of tips from CS 251 staff and students. Have more? Let us know.

  • Take notes in class. The slides can be useful, but they are just a prop. The most useful and interesting insights happen in exercises and other discussion. Writing down your solutions (and your approach!) is great reference for review later.
  • Ask questions in class, in office hours, in tutor hours, in lab, of your classmates or on the email list (but first, read the Honor Code definitions). The knowledge will not come to you. Go get it. We will often answer your questions with more questions.
  • Read the instructions on assignments and understand the specifications. There is often good advice about how to approach the problem most effectively.
  • Work incrementally. As you work through an assignment (after you understand it), think and plan before you ever write any code or build any circuit. Writing code before planning and writing one big pile of code before testing are two sure routes to disaster. Plan carefully before you ever touch the keyboard. Write pseudocode. Draw diagrams. When you are ready to write code, do it incrementally. Write a small piece. Write assertions to document your assumptions. Test it. Does it work? No? Repeat until it does. Now, commit it so you can get back to this point if things go wrong later. Then, write the next small piece, and so on. Step back occasionally and consider if you are still on track for your plan. Does it need adjustment?
  • Read specifications carefully and think critically about how best to implement them.
  • Consult documentation to learn about relevant tools and library functions.
  • Experiment to try out potential ideas.
  • Start assignments early and meet the checkpoints. (Really, early! Really early. Ask any CS 251 alum.) Before you can “just finish” the assignment, you will need time to absorb the task, understand how to approach it, plan, take a break when you get stuck (time away from a problem almost always helps), debug, ask questions, and more.
  • Come to class. We do useful and fun things. If you do not think so, then let us know!
  • Work in the lab space. Tackling challenging assignments next to your classmates builds camaraderie, reminds you that everyone has to work hard on these assignments, eases sharing of tips and techniques, and affords opportunities for collaborative silliness.
  • General tips from PLTC / Academic Peer Tutoring:

Faculty Responsibilities on Disclosures of Discrimination, Harassment, and Sexual Misconduct

Pursuant to Wellesley College policy, all employees, including faculty, are considered responsible employees. That means that any disclosure of discrimination, harassment, or sexual misconduct to a faculty member will need to be shared with the College’s Director of Non-Discrimination Initiatives / Title IX and ADA / Section 504 Coordinator, Janet Elie Faulkner (781-283-2451; titleix@wellesley.edu). Students who do not wish to have these issues disclosed to the College should speak with confidential resources who are the only offices at the College that do not have this same reporting obligation. On campus, confidential resources include Health Services (781-283-2810 available 24/7), the Stone Center Counseling Services (781-283-2839 available 24/7) and the Office of Religious and Spiritual Life (781-283-2685). You should assume that any person employed on campus outside of these three confidential offices has an obligation to share information with Wellesley College through the Office of Non-Discrimination Initiatives.

  1. This course is officially named “Theory of Programming Languages”, but we do not confine ourselves to theory. 

  2. I refer to this as “light” mastery grading because it emulates an important feature of what is commonly known as mastery grading, but (a) it applies only to two exams, (b) the grades assigned may be numerical instead of employing a system of discrete mastery levels, and (c) both exams will include some conventional “one shot only” material as well. These differences are in contrast to how true mastery grading is applied more fully, e.g., in some math courses at Wellesley.