CS 476: Programming Language Design

technical elective, 3 or 4 credits

Instructor: William Mansky

Overview

The purpose of this course is to learn how to think about, describe, and reason about the features of different kinds of programming languages. We will cover the theoretical frameworks that are used to define and describe the behavior of different languages, and build interpreters that implement pieces of those languages. We will cover the key features of imperative, functional, and logic languages, as well as concurrency, I/O, and various other features.

By the end of this class, you will know how to:

  • formally describe the syntax and semantics of programming languages
  • build interpreters for new languages and extend existing languages with new features
  • use a range of mathematical tools for specifying program behavior
  • understand the features of different language paradigms, including imperative, functional, object-oriented, and logic
  • formally describe type systems, and implement type checking and inference

Prerequisites

The main prerequisite for this class is CS 341. I will assume some familiarity with functional programming (F#, Haskell, OCaml, etc.); if you haven’t done functional programming before and you still want to take the class, I’d recommend spending some time on https://ocaml.org/learn/. It will also help to be familiar with propositional logic, induction, and formal proofs, as taught in CS 201, MCS 361, or equivalent.

Welcome!

I’m glad you’re taking this course, and excited to explore programming language design with you. That said, your wellbeing is more important to me than your coursework. I’ve tried to plan the course so that it’ll be fun, interesting, and not too much of a burden, but if there’s more I can do, please let me know. Likewise, if circumstances prevent you from completing an assignment or make it difficult for you to keep up with the course, let me know and we can figure something out. I’ve enabled anonymous posts on Piazza, so you can give feedback fully anonymously if you want to.

Communication

The class discussion board on Piazza is the best place to post questions about the course material, assignments, course policies, exams, and anything else. Remember, if you have a question, someone else probably does too! You can ask and answer anonymously, and you can also use it to send messages to the instructors (we check it more often than email). There will be a small amount of extra credit available for being a good citizen on the discussion board – asking questions, answering questions, and generally being helpful. (Remember that I can’t give you extra credit for fully anonymous posts!)

Evaluation

Grades are curved based on an aggregate course score, with separate curves for graduate and undergraduate students. This means that the course score cut-offs for an A, B, C, etc. are not defined ahead of time: these will be set after the end of the course.

The course grade weighting is:

Task % of total grade
In-class exercises 25
Assignments 60
Project 15

Attendance and Participation

Class will meet three times per week. You can find the topics for each class on the [schedule page][schedule]. Each class will include a short exercise to reinforce the material. This is an on-campus course, but classes will also be recorded and available on Blackboard. If you are not able to attend a class live, you can watch the recording and submit the exercise when you are able, no later than 1 week after the class. A small amount of extra credit will be available for active participation in class or on Piazza. Office hours will be held both in-person and online.

Textbook

The main textbook will be Types and Programming Languages, by Benjamin Pierce. We will also occasionally use readings from other textbooks. One copy of the textbook is on reserve at the library (so you don’t need to buy it!), and it is freely available as an ebook on the library website. We will also use readings from The Formal Semantics of Programming Languages: An Introduction by Glynn Winskel, also available freely online.

Assignments

There will be two kinds of assignments in this class: programming assigments in OCaml, and written assignments. Programming assignments will involve implementing interpreters, type checkers, etc. for programming language features. Written assignments will test your understanding of the logical systems used in programming language design. Be sure to consult the online handout, and feel free to post questions on Piazza. Assignments will be submitted via Gradescope.

Each assignment will be submitted twice. You will receive feedback on your first submission, and your second submission should take that feedback into account. You will receive full credit for the first submission as long as you submit any work; the second submission will be graded based on the assignment criteria. If your first submission doesn’t need any improvement you can resubmit the same code, but if you receive any feedback at all, you are strongly encouraged to try to address at least some of it. You can still submit something for the second deadline even if you haven’t submitted for the first, but you will miss the chance to receive feedback and correct mistakes. If you don’t have time to complete the assignment by the due date, submit as much as you can whenever you can.

Academic Integrity

You are encouraged to consult with your classmates on the assignments, but you should write your own code, and copying code/proofs from your classmates without citation is considered plagiarism. Given the question “how did you do X?”, a great response would be “I used function Y, with W as the second argument. I tried Z first, but it doesn’t work.” An inappropriate response would be “here is my code, look for yourself.” If you ask for help from sources outside the course, you must clearly state that you’re asking for help on homework for a class.

In keeping with academic and professional ethics, you must cite your sources in all submitted materials. List classmates you discussed your homework with and webpages from which you got inspiration or copied code. All students are expected to understand and be able to explain their submitted materials, and may be asked to do so at the instructor’s discretion. Plagiarism and cheating, as in copying the work of others, paying others to do your work, etc., is prohibited, is grounds for failing the course, and will be reported.

Assignments and ChatGPT

The majority of the course grade will come from assignments. Each assignment will be submitted twice: the first time you’ll get feedback but not a grade (you’ll get credit as long as you submit any progress), and the second time will be graded. I strongly recommend against using ChatGPT/Copilot/etc. for the first submission, because it means you won’t be able to get feedback based on your understanding of the problem, and if ChatGPT’s answer is wrong it’ll be hard to figure out how to fix it. It’s probably not a great idea for the second submission either, because a lot of the problems we’ll work on are prone to subtly wrong but “right-looking” answers, which ChatGPT is good at generating. That said, if you’re having trouble writing syntactically correct OCaml code, ChatGPT could be a good way to get started. Like all outside sources, you should cite ChatGPT if you use code that comes from it.

Accessibility

UIC is committed to full inclusion and participation of people with disabilities in all aspects of university life. Students who face or anticipate disability-related barriers while at UIC should connect with the Disability Resource Center (DRC) at drc.uic.edu, drc@uic.edu, or at (312) 413-2183 to create a plan for reasonable accommodations. To receive accommodations, you will need to disclose the disability to the DRC, complete an interactive registration process with the DRC, and provide me with a Letter of Accommodation (LOA). Upon receipt of an LOA, I will gladly work with you and the DRC to implement approved accommodations.

Mental and Emotional Health

Your mental health and emotional wellness are at least as important as academic success. The UIC Counseling Center offers an array of services to provide additional support throughout your time at UIC, including workshops, peer support groups, counseling, self-help tools, and initial consultations to speak to a mental health counselor about your concerns. Please visit the Counseling Center website for more information (https://counseling.uic.edu/). Further, if you think emotional or mental health concerns may be impacting your academic success, please contact your faculty and academic advisers and we can try to make things more manageable.

Religious Holidays

The UIC Senate Policy on religious holidays is below. The short version is: I will try not to make anything due on religious holidays, but if I do, please let me know at least 5 days in advance and we’ll figure out an alternative.

“The faculty of the University of Illinois at Chicago shall make every effort to avoid scheduling examinations or requiring that student projects be turned in or completed on religious holidays. Students who wish to observe their religious holidays shall notify the faculty member by the tenth day of the semester of the date when they will be absent unless the religious holiday is observed on or before the tenth day of the semester. In such cases, the students shall notify the faculty member at least five days in advance of the date when they will be absent. The faculty member shall make every reasonable effort to honor the request, not penalize the student for missing the class, and if an examination or project is due during the absence, give the student an exam or assignment equivalent to the one completed by those students in attendance. If the student feels aggrieved, they may request remedy through the campus grievance procedure.”

Nondiscrimination

UIC is committed to the most fundamental principles of academic freedom, equality of opportunity, and human dignity involving students and employees. Freedom from discrimination is a foundation for all decision making at UIC. Students are encouraged to study the University’s Nondiscrimination Statement. Information on relevant policies and procedures is available on the University web pages of the Office of Access and Equality.

Classroom Conduct Policy

Please be prepared to act according to our classroom conduct policy:

  • Be present during class. Put away cell phones and remove yourself from other distractions.
  • Be respectful of the learning space and community. For example, avoid side conversations or unnecessary disruptions.
  • Use your classmates’ preferred names and gender pronouns.
  • Assume goodwill in all interactions, even in disagreement.
  • Facilitate dialogue and value the free and safe exchange of ideas.
  • Try not to make assumptions, have an open mind, seek to understand and not judge.