CS 320
      Principles of Programming Languages
Course Information and Syllabus
Spring 2020
(Last Updated: 3 April 2020)

IMPORTANT: The pdf version of this document that is posted on D2L will not be updated once the term has started. Its purpose is to maintain an accurate record of the course syllabus as of the date shown above, and as distributed in the first class. For updates and additional resources, please consult the D2L web pages.

Note that I fully expect that this information will be updated.  We are living through times that are unlike anything that we have ever experienced, and even the best laid plans are unlikely to execute smoothly.  It is quite likely that both students and instructors will have to improvise.  All we can do is the best that we can.


COURSE ORGANIZATION

Instructor

Name email Phone Office Hours Zoom
Andrew P Black apblack@pdx.edu 503 725 2411
Monday & Wednesday 13:00-15:00, or Thursday 12:00–13:50
Schedule an "office hours visit" at https://calendly.com/apblack
https://pdx.zoom.us/my/black.pdx


I hate email, and do not do a good job of keeping up with it. The class discussion forums are the best venue to ask general and technical questions, because
  • any of the teaching staff, or other students, can answer, not just me
  • other students probably have the same question; every one in the course can benefit from the same answer

You can schedule an "office hours" conversation with me at the above calendly link.  If you can't or don't want to use Zoom, we can also use plain old telephone service (POTS);
the above number will ring my mobile phone.   If you need to schedule a meeting at another time, please telephone.  If you must email me, please send a list of times that will work for you.

Teaching Assistants

Name email Office Hours
Zoom
Willis Hoke
whoke@pdx.edu Thursday 10:00–12:00 and Friday 12:00–14:00
https://pdx.zoom.us/my/whoke
Evan Johnson
emj3@pdx.edu Monday 16:00–18:00 and Tuesday 14:00–15:50
https://pdx.zoom.us/my/emj3.pdx

We will rely on students in the course to let us know if the posted office hours times do not work, or if additional TA office hours should be added.

Meeting Times and Locations

Every student should be signed up for CS 320 lectures, and CS 320L lab.  Signups for the lab slots was limited to the capacity of the physical lab; now that labs are going to be virtual, this restriction is unnecessary,   Please sign up for a lab session at a time you think you will be able to attend.

Timeslot Time Enrolled
Lecture
Tuesdays, 10:00–11:50
89
Lab 01
Tuesdays, 14:00–15:50
19
Lab 02
Wednesday 14:00–15:50
13
Lab 03
Thursday, 10:00–11:50
30
Lab 04
Thursday 12:00–13:50
18

My current plan is to make the material that would have been delivered in Tuesday's Lecture available on Monday as one or more video recordings, and to use Tuesday's 10:00–11:50 scheduled meeting time for discussion and questions. 

I also plan to make the material that would have been delivered in the lab sessions available as video recordings.  I hope students will organize themselves into small (2 or 3 person) lab groups and tackle the lab assignments collaboratively.  Because every student should have planned to be available at the assigned times, I hope that these will serve as starting times for lab group meetings.

Class Web Page, Discussion Site, Announcements

We will be using D2L (http://d2l.pdx.edu; Odin account required for login) for static material—lecture slides and videos.  We will also be using it for some quizzes.

We will be using Piazza for class discussion. The system is highly catered to getting you help fast and efficiently from classmates, the TAs, and the instructor. Rather than emailing questions to the teaching staff, I encourage you to post your questions on Piazza. If you have any problems or feedback for the developers, email team@piazza.com.

Find our class page at: https://piazza.com/pdx/spring2020/cs320/home. You can configure Piazza to send you email when something new is posted.  There is also a handy Piazza App for your phone, which can allert you to new posts.

All students are expected to read announcements on Piazza; I hope that you aslo take part in discussions.

There is also a Slack channel at https://pdx-cs.slack.com/#cs320_spring_2020 that is intended for informal communication and questions about the course. Use it freely. The instructor and TAs will monitor it  and contribute when that seems useful.

Codio Coding Platform

We will be using the Codio platform to distribute and collect assignments.  You can also use Codio to write, test and execute your homework submissions.  Connect to our class on codio at https://codio.com/p/join-course?token=planet-orion

If you prefer to code the homeworks on your own machine, that's fine.  You will still have to upload your assignments to Codio for submission.

Course Description

Syntax and semantics. Compilers and interpreters. Programs as data. Regular expressions and context free grammars. Programming paradigms, including procedural, functional, and object-oriented programming. Type systems, including dynamic and static typing disciplines. Binding, scope, data abstraction, and modularity. Denotational, operational, and axiomatic semantics. Introduction to program correctness. (The official description is available at https://www.pdx.edu/computer-science/cs320.)

Prerequisites

This class requires CS 202 and CS 251, passed with grades of C or better. These courses provide you with the background that you will need to understand the course material and develop solutions to the assignments that you will be given. It is assumed that you have experience programming in a high-level, object-oriented language (specifically, C++ or Java, from CS 202 and earlier classes). If you have not completed the prerequisites, then you may not have the background that you need to pass this class. In this case, by default, you will not be able to continue in the class and you should contact the instructor at the earliest opportunity to avoid an administrative drop.

Course Objectives/Student Learning Outcomes

Upon the successful completion of this course students will be able to:

  1. Explain the distinction between language syntax and semantics.
  2. Describe the similarities and differences between interpreters and compilers.
  3. Explain the phase structure of a typical compiler and the role of each phase.
  4. Use regular expressions and context-free grammars to describe the syntax of simple programming languages.
  5. Illustrate the features and characteristics of different programming paradigms, including procedural, functional, and object-oriented programming.
  6. Explain the concepts of binding, scope, block structure, and lifetime, and apply them to resolving variable uses to their binding sites in a variety of languages.
  7. Describe and apply the basic concepts of type systems, including primitive types, compound, and recursive types, abstract data types, and type equivalence models.
  8. Describe the strengths and limitations of static and dynamic typing disciplines.
  9. Describe and apply the basic concepts of data abstraction, encapsulation, object-oriented classes, and modules.
  10. Explain basic approaches and applications for the formalization of programming language semantics.

Outline of Course Content (SUBJECT TO CHANGE)

The following outline represents a tentative schedule for the course and is subject to change.

Week Week starting
Lecture Topic
1 March 30 Course overview. Syntax and Semantics. Program equivalence, and the distinction between syntactic and semantic equivalences. Representation of programs as abstract syntax trees. Distinctions between concrete and abstract syntax and between static and dynamic semantics. Functional Programming. Haskell. Programming without side effects. Recursion. Processing structured data. First-class functions. Binding and scope.
2 April 6
Programs that manipulate programs as data. Basic principles in the function and construction of interpreters, compilers, program generators, and program analysis tools.
3 13 Techniques for describing language syntax. Context-free grammars, and common usage patterns.
4 20 Type systems. A type as a set of values together with operations. Primitive types. Compound types. Product and sum types. Recursive types. Parameterized types.
5 27
Type checking. Association of types to variables and values. Dynamic and static typing disciplines. Type safety. Decidability issues. Interpreting type error messages. Scripting languages. Python.
6 May 4
Midterm exam. (Post-midterm) Review.
7 11 Stateful objects. Classes, fields, methods, and constructors. Subclasses, inheritance, method overriding, and dynamic dispatch. Object lifetime. Object-oriented programming. Java.
8 18
Abstract types. Modularity and encapsulation.
9 25 Techniques for formalization of programming language semantics, including denotational, operational, and axiomatic approaches.
10 June 1
Introduction to program correctness. Program specification using predicate logic. Application of formal semantics, and the role of tools for mechanized reasoning.

In accordance with University Guidelines, the final exam is scheduled for Tuesday, June 9, 10:15–12:05.   You should keep that time-slot open.

Course Requirements and Method of Evaluation

The course will be assessed by a combination of exams, and lab/homework exercises.

There will be one midterm exam (in Week 6) and one final exam (in Finals week), both of which will be open-book. Exams are scheduled in advance and, unless a prior arrangement is made, a grade of zero will be recorded for missed exams.  Exactly how these exams will be administered remains to be determined.

The midterm will contribute 20% of your overall grade for the class, while the final will contribute 30%. The remaining 50% will be determined by homework assignments and in-class quizzes. The homework assignment for a given week is likely to be a continuation of work that was begun in the lab sessions for that week.  My general expectation is that answers will include appropriate explanation, justification, or supporting commentary that show that you understand why your answer is correct. The grading schemes for individual assignments will typically include points specifically for these items, so writing only the final answer to a question, even if it is correct, may not earn full marks.

For questions that require programming, you will often be asked to include evidence of "thoughtful testing". The intent here is that you aim for quality of tests rather than quantity, focusing on which aspects of your solution are exercised by your tests, the handling of edge cases, and the steps that you took to determine what the correct behavior or result should be. If you just show the output from running a program without including further commentary to justify or explain the results, then all you are really doing is showing that your program runs, and not that it is correct.

There may be some assignments that are not formally assessed. This might include written exercises, additional reading, or watching prepared videos, etc. These will be designed to help you master the subject, to keep pace with the lectures, and to prepare for the exams, so it will be very important for you to keep up to date with those exercises.


RESOURCES

Required Texts and/or Required Reading List

The slides and other materials that are presented in the video-recorded lectures will be archived on the course web site are required reading.

There is no required textbook for this class, but all students are strongly encouraged to do background reading in parallel with the coverage of topics in class. There are many textbooks on the subjects of this course, including a good range that are available in the PSU library. However, we do not require you to buy or have access to any particular text: for example, we will not set exercises that come from a textbook.

Of course, there are plenty of good resources on the Internet of direct relevance to this course that can be found on sites like Wikipedia or simply by searching on Google.  If you prefer a textbook, we recommend  the following:

  1. Programming Languages, 3rd Edition.  ISBN: 9781111529413 Author: Louden Publisher: Cengage Learning
  2. Programming in Haskell 2nd Edition. ISBN: 9781316626221 Author: Hutton. Publisher: Login Canada

Computing Facilities

The assignments for this course will require the use of a variety of programming language implementations. Students may develop their solutions on any machine and operating system on which these implementations are available. At a minimum, all of the systems that we use will be installed on the departmental Linux systems that can be accessed in person in the lab area, or remotely via ssh/putty.

The Importance of Asking for Help

A fundamental assumption and expectation of this course is that students will ask for help or clarification if they have any problems understanding the course materials, or the work that is required for an assignment. As general guidelines:

  • Questions may be asked in person (during the lecture time, or office hours, for example) or online using the D2L forums (preferred) or email (for personal matters, or lower-priority questions).

  • In general, we will prioritize conversations on public forums (e.g., D2L and Slack) over individual email because public postings have the potential to benefit the largest possible group of people. We will also prioritize conversations in persistent forums (e.g., D2L) over those that are more transient (e.g., Slack) because the former are more likely to serve as a reference for other students exploring similar questions or topics. If you send a message by email, we will still try to respond as quickly as possible, but may need to respond to public postings first or to other individual email messages that arrived before yours.

  • Anonymous posting on D2L is permitted for those who are uncomfortable about posting questions under their own name.

  • To avoid a breach of academic integrity (see details below), do not include specifics of your solution in public postings on D2L or Slack; instead, please try to phrase your questions, comments, or answers in general terms.

  • Do not use D2L "email". This facility generates invalid sender addresses, which are not recognized by the PSU mail system.

  • You should ensure that you are subscribed to receive notifications when news items or new forum messages are posted on D2L. If you do not subscribe for these updates, then you may miss important announcements, clarifications, or updates.

  • If you are not comfortable asking, or do not have time to ask, for help, then you may find that the course is (perhaps considerably) more difficult than intended. In this situation, you may want to consider whether it is appropriate for you to be taking the course at this time: please contact the instructor if you have any concerns about this.

"Shouldn't I be able to do this by myself?" Students sometimes say that they want to be able to do the assignments by themselves without any additional input. That's a commendable attitude, but it is NOT appropriate in this class and it is not representative of how things work in the real world: practical projects typically rely on the need for interaction with customers, peers, supervisors, and other colleagues with more experience or different perspectives. Another common problem may occur for a student who is struggling to phrase their question. If you find yourself in this position, you are encouraged to review the relevant course materials (and question or reference text, where appropriate): can you identify the parts that make sense to you, and the parts that are unclear? The more precisely you can identify the source of any confusion or uncertainty, the easier it will be to provide specific guidance. For example, perhaps you can point to a specific item on a slide, or a particular phrase or paragraph in an assignment text that doesn't make sense to you? Does it appear to contradict something you've seen elsewhere, or use vocabulary or terminology that isn't familiar to you, for example? Even if you cannot pin down all the details, the process of trying to formulate a question can, itself, be helpful in clarifying the source of a misunderstanding. And even if you still cannot formulate a very specific question, we will nevertheless do our best to help you.

"I don't want to embarrass myself." Another common concern is a fear of embarrassment or a sense of shyness: a student may worry that their questions will reveal a gap in their understanding, or even just the fact that they started late or weren't paying attention in class when a topic was covered in class. Although it can be difficult to overcome these fears, in a class of any reasonable size, it's almost certain that any question that one student has will also be on the mind of, or directly relevant to, other students as well. As such, when a student asks a question, particularly in a public forum such as during the discussion section or on D2L, there is an enormous potential benefit to other people. For starters, there is a very real chance that you and other students will learn useful things in the process. Moreover, the instructors will also gain new insights about the way that the material was taught or understood—including gaps or mistakes in the way the ideas were presented—which they can then use as input to clarify, expand, and improve the treatment. For these reasons, we strongly encourage you to ask questions in "public" settings where possible.  For those who still feel uncomfortable about this, we will also do our best to respond to "private" inquiries.

"You're probably too busy." Some students hold back from asking questions because they think that the instructor or TAs might be too busy. It's true that we may be busy, but please don't forget that we are here (and are being paid!) to help you learn. Interacting with you and answering your questions is one of the best ways we have to help you do that. You're certainly not "bothering us" or "wasting our time" when you ask us questions: you're just giving us a chance to do our jobs and help you learn the course material!

The Danger of "spinning your wheels": Students sometimes mention that they have been working on a question for "many hours" before getting in touch to ask a question. By the time this happens, they have invested a lot of time and energy in a specific problem, but have little to show for it, and are understandably feeling more than a little frustrated. In some cases, a student may say this because they want to assure us that they have made a serious attempt to understand the material and solve the problem themselves; it may well be that many hours have passed on the clock in the process, but that time may not have been spent productively, and the end result might be that it takes much longer for a student to complete an assignment as a result of some relatively small misunderstanding or detail that could have been clarified quite quickly. It is definitely a good idea for students to spend and invest real time and energy to understand and work through problems on their own; many of us learn a great deal as a result of struggling with a problem, and perhaps failing to find a solution in our first few attempts to solve it. However, it is also important to develop enough self awareness to be able to tell when you are simply "letting your wheels spin", essentially making no progress and failing to use your limited time in a productive way. A good first step if you feel this happening to you is to take a break: do something else, take some physical exercise, sleep, etc. But ultimately, this may just be a sign that you need to reach out for help or clarification.


POLICIES

Academic Integrity

We follow the standard guidelines for academic integrity. This is important because a breach of academic integrity by one student undermines the efforts and achievements of the other students in the class who have made honest and legitimate attempts to study for and complete assignments and exams.

  • You are allowed to work together on labs and homeworks. However, you must prepare and submit your solutions individually.
  • Exams must be completed individually without any collaboration.
  • Plagiarism or collaborating on an exam will result in an automatic zero grade and the initiation of disciplinary action at the University level.

It is permissible to discuss assignments with students outside of your lab group, but you must develop within the group. Do not, under any circumstances, copy any part of another person's solution and submit it as your own; this is plagiarism.  Each homework answer should state your personal role in developing it; it needs to be absolutely clear to the grader what is the work of your own hand, and what should be attributed to others in your lab group.  Obviously, we will be comparing the attributions from all members of the group.

Posting or soliciting all or part of your solution on D2L or any other public forum, media, or site may be considered a breach of academic integrity. Writing code for use by another lab group, or using another person's code without attribution, will be considered cheating. Cheating on an assignment or exam will result in an automatic zero grade for that piece of work, and the initiation of disciplinary action at the University level. Please refer to http://www.pdx.edu/dos/codeofconduct for details of the general PSU Student Code of Conduct. Any student with questions about academic integrity issues, either relating to their own behavior, or with concerns about the behavior of other students, should contact the instructor. All such matters will be treated in confidence.

Always remember that the instructor and the TAs are here to help you to succeed in this class; if you find yourself in a difficult position, do not be tempted to cheat, and instead get in touch to ask for some help or guidance.

Discrimination and Misconduct

  • Portland State is committed to fostering a safe, productive learning environment. Title IX and university policy prohibit gender or sex-based discrimination and sexual misconduct (including harassment, domestic and dating violence, sexual assault, and stalking).

  • We expect a culture of professionalism and mutual respect in our department and class. You may report any incident of discrimination or discriminatory harassment, including sexual harassment, to either the Office of Equity and Compliance or the Office of the Dean of Student Life.

  • Please be aware that members of the faculty have the responsibility to report any instances of sexual harassment, sexual violence and/or other forms of prohibited discrimination to PSU's Title IX Coordinator, the Office of Equity and Compliance or the Dean of Student Life and cannot keep information confidential.

  • If you would rather share information about sexual harassment or sexual violence to an employee who does not have this reporting responsibility, you can contact a confidential advocate at 503-725-5672 or on-line; other confidential employees can be found on the sexual misconduct resource webpage.

  • For more information about your obligations and resources for sex/gender discrimination and sexual violence (Title IX), please complete the required student module Creating a Safe Campus in your D2L.

Disabilities and Accommodations

We will do everything possible to provide accommodations, with full confidentiality, to any student who needs them. All accommodations must be approved by the Disability Resource Center, which establishes fair and consistent standards across campus. Students with a documented disability who are registered with the Disability Resource Center are responsible for ensuring that their specific requirements are clearly communicated to the instructor at the earliest possible opportunity, either directly or via the DRC. Students should take steps to notify the instructor as soon as possible if they feel that their needs are not being met. If you have accommodations that include taking tests at the University test center, then you are strongly recommended to schedule those tests so that they coincide with the time that the other students are taking the test in the main classroom. It is important that you take steps to make the necessary reservations at the earliest possible opportunity, noting that the times and dates for both the midterm and final exams are already fixed for 4 May and 9 June, respectively, as described above. The instructor is happy to provide additional guidance to any student in this situation, but it is the student's responsibility to make the appropriate arrangements and to share those details with the instructor in a timely manner.

Other Policies and Guidance

In addition to the specific items described above, we adopt the following policies and guidance:

  1. By default, all deadlines are firm. At the discretion of the instructor, penalties may be assessed for late submissions.

  2. No homework or exam submissions can be accepted once a sample solution has been distributed and/or discussed in class or online.

  3. In general, writing only the correct answer may not earn you full marks for an assignment, and you should also be prepared to include appropriate explanation, justification, commentary etc. The intent here is that you should be able to say not only what the correct answer is, but also to explain why it is the correct answer.

  4. We are unable to provide detailed feedback on draft versions of assignment solutions prior to submission; feedback of that kind might be considered as providing an unfair advantage over other students who are not able to get their work "reviewed" prior to submission. We are happy, however, to address any questions that might help to clarify the expectations and requirements for an assignment.

  5. Students are solely responsible for ensuring that their attempts to upload homework solutions to D2L are successful. A "miscellaneous uploads" dropbox will be provided for students to submit material after the deadline for a given assignment has passed, but there is no guarantee that items submitted there will be accepted or considered for grading. Any student who uses the miscellaneous uploads dropbox should also notify the instructor directly.

  6. We try hard to ensure that grading is fair and accurate. But we also acknowledge that, as with any human process, there will always be a possibility for mistakes. In addition, even if the grading is correct, a student may not always understand why they have been assigned a specific score. For these reasons, students are welcome to seek clarification/explanation for grading decisions at any time during the term before final grades are submitted. We will never reduce the grade awarded as a result of reviewing work in this way, but there is also no guarantee that any grades will be increased as a result of review. Reviews of grading are appropriate whenever they might help to improve understanding or learning, but they should not be used as a matter of routine, and should not be used primarily as a way to try to boost scores. Reviews of this kind are typically only useful (and hence should usually only be requested) after sample solutions and grading guides have been distributed by the instructor and reviewed by the student.

  7. To ensure consistency, all questions about matters that are potentially subjective—such as possible grading errors or determining whether an exceptional circumstance warrants an extension of a deadline—should be addressed to and answered by the primary instructor.

  8. We will try to be as flexible as possible in accommodating special circumstances. If you anticipate a specific issue, please talk to us to make arrangements in advance. Note, however, that it will not be possible for any student to take either the midterm or final exam at an earlier time than is posted in the schedule.

  9. As specified in Oregon law (ORS 165.40 6(b)), recording of oral communications that are part of regularly scheduled classes is permitted if the recording device is not concealed. To respect the privacy of students and to avoid actions that might discourage or inhibit participation in class, please treat any such recordings as "for personal use only".

Every student should send an email to the instructor before the second lecture to indicate that they have read and understood this syllabus.