CSCI 599: An Introduction to Programming Languages

Fall 2023

Logistics

Classes: Fridays, 1:00–4:20pm · DMC 201 · [Zoom]
Piazza: https://piazza.com/usc/fall2023/csci59930064d
Instructor: Mukund Raghothaman (raghotha@usc.edu)
Teaching Assistant: Amirmohammad Nazari (nazaria@usc.edu)
Office hours: Fridays, 4:30–6:30pm, or by appointment · SAL 308
Wednesdays, 2–4pm, or by appointment · PHE 102

Course Description

This course will introduce you to a range of advanced programming paradigms. We will assume an elementary knowledge of programming, such as that covered in CSCI 103 and CSCI 104, and study powerful ways of structuring code with higher-order functions, of providing strong guarantees with static type systems, and ways to liberate the programmer from low-level resource management. By blurring the distinction between programs and data, and widening the gap between a program and its execution, our goal is to blow your mind about what it means to program a machine, and to reinforce your developing sense of computational thinking. The first half of the course can alternatively be seen as an introduction to functional programming with Ocaml, while the second half of the course can be regarded as an introduction to logic programming.

Note: The syllabus and schedule listed on this webpage are tentative, and may be updated as the course progresses. Please check back regularly!

Schedule

Unit 1: Functional Programming in Ocaml

Aug 25 Course introduction
Sep 1 An introduction to types
Sep 8 Abstracting computations with functions
  • Recursive definitions
  • Higher-order functions: Functions as arguments, as return values, and those of the anonymous kind; arrow types
  • Execution model: Evaluation order and scoping rules
  • Reading: RWO Chapter 2: Variables and Types
  • [Recording], [Notes], [l03.ml]
Sep 15 Processing recursive data

Unit 2: Implementing a Language Interpreter

Sep 22 Understanding syntax
  • Describing syntax with regular expressions and context-free grammars
  • Lexical analysis with finite state automata
  • Reading: RWO Chapter 19: Parsing Data with Ocamllex and Menhir
  • [Recording], [Notes]
Sep 29 Syntax, contd.
Oct 06 Syntax, contd. 2: Parsing algorithms for regular expressions and context-free grammars
Oct 13 Fall Recess. No class
Oct 20 An elementary understanding of types and the runtime

Unit 3: Programming with Relations

Oct 27 Spreadsheets
  • Mukund attending OOPSLA, class held over Zoom
  • The computational model: Cells, values, formulas and dependence graphs
  • Pivot tables, array formulas and lookups
  • Turing-completeness of spreadsheets as a programming medium
  • Forgot to hit record, sorry! We talked about the organization of virtual memory in [Linux], the mmap system call (see [here] and [here]), and used [strace] to collect experimental evidence that these things are real and not invented by CS professors
Nov 3 The relational data model
Nov 10 Veteran's Day. No class
Nov 17 An introduction to recursive query languages
Nov 24 Thanksgiving. No class
Dec 1 More on recursive query languages, course conclusion and review
  • The problem of negation
  • What was this course all about?
  • Reflections on the future of programming
  • [Recording], [Notes], [Code12.zip]
  • See the Souffle documentation for a description of Datalog: [programs], [rules], and [aggregation]
  • See Susan Davidson's lecture slides from Penn: [1], [2], and [3]
  • See Paris Koutris's [notes] for a discussion of stratified negation; this is based on Sections 15.1 and 15.2 of the [Alice] textbook
Dec 13 Final exam (11am–1pm)

Readings

The first half of the course will follow the Real World Ocaml textbook. This is the only required textbook for this course. We will assign additional supplementary readings as appropriate.

  1. Yaron Minsky, Anil Madhavapeddy, and Jason Hickey. Real World Ocaml. 2nd edition. O'Reilly, 2021. [Link]
  2. Michael Clarkson. Ocaml Programming: Correct + Efficient + Beautiful. 2022. Course notes from CS3110, a somewhat similar course offered at Cornell. [Link]
  3. Harold Abelson, Gerald Jay Sussman, and Julie Sussman. Structure and Interpretation of Computer Programs. 2nd edition. The MIT Press, 1996. [Link]

Development Environment

  1. Ocaml: Please follow the instructions described here.
  2. Datalog: Obtain Souffle from here, and follow the build instructions described here.

Grading

  1. Homework assignments: 3 × 17% = 50%
  2. 2 quizzes and a final exam: 3 × 17% = 50%

On Collaboration

You are welcome to discuss homework assignments with a partner. However, each of you will turn in your submissions separately. You will each be responsible for independently writing and physically typing the solutions in your submission. Please identify your discussion partner, if any, in your submission.

Policies

From Dornsife's academic conduct policy: Plagiarism—presenting someone else's ideas as your own, either verbatim or recast in your own words—is a serious academic offense with serious consequences. Please familiarize yourself with the discussion of plagiarism in SCampus in Part B, Section 11, "Behavior Violating University Standards." Other forms of academic dishonesty are equally unacceptable. See additional information in SCampus and university policies on scientific misconduct, here.

Discrimination, sexual assault, intimate partner violence, stalking, and harassment are prohibited by the university. You are encouraged to report all incidents to the Office of Equity and Diversity / Title IX Office here, and / or to the Department of Public Safety. This is important for the health and safety of the whole USC community. Faculty and staff must report any information regarding an incident to the Title IX Coordinator who will provide outreach and information to the affected party. The sexual assault resource center webpage fully describes reporting options. Relationship and Sexual Violence Services webpage provides 24/7 confidential support.

Note on collaborative work: For collaborative projects, students are expected to have equal distribution of work. If there is any perceived imbalance in the collaborative project, the student should bring this to the attention of the instructor or the teaching assistant.

Assistance with writing and disabilities: Several USC's schools provide support for students who need help with scholarly writing. Check with your advisor or program staff to find out more. Students whose primary language is not English should check with the American Language Institute which sponsors courses and workshops specifically for international graduate students. The Office of Disability Services and Programs provides certification for students with disabilities and helps arrange the relevant accommodations. If an officially declared emergency makes travel to campus infeasible, USC Emergency Information will provide safety and other updates, including ways in which instruction will be continued by means of Blackboard, teleconferencing, and other technology.

Last updated: Mon Dec 11 05:04:44 PM PST 2023