CS 381: Programming Language Fundamentals (Winter 2020)

Instructor: Eric Walkingshaw ()
TAs: Ghadeer Al Kubaish (alkubaig)
Parisa Ataei (ataeip)
Daniel Fedorin (fedorind)
Kai Gay (gayk)
Jeff Young (youngjef)
Lectures: MWF, 11:00–11:50am, Withycombe Hall 109 (map)
Office Hours: Mon 3:00–4:00pm – Jeff, KEC Atrium
Tues 1:00–2:00pm – Daniel, KEC Atrium
Wed 10:00–11:00am – Parisa, KEC Atrium
Wed 4:00–5:00pm – Ghadeer, KEC Atrium
Thur 12:00–1:00pm – Eric, KEC 3049
Thur 3:30–4:30pm – Kai, KEC Atrium
Piazza: CS 381 on Piazza (Use of Piazza)

Course Description and Essentials

This course covers the fundamentals of language design and implementation. You will learn how to define a language in terms of syntax and semantics, and how to decompose and reduce a language to its core features in order to simplify this process. You’ll also practice writing programs in non-imperative languages. We use the purely functional programming language Haskell for the majority of the course, and then spend the final two weeks writing logic programs in Prolog.

  • Community Statement – Every student should feel safe and welcome to contribute in this course. Please read this statement and let’s work together to make this a great environment for everyone.

  • Grading and Homework Policy – How grades will be computed and course policy on homework, quizzes, and exams.

  • Haskell and Prolog Resources – How to get up and running with Haskell and Prolog. Also lists several tutorials, freely available books, and other resources that you should use to supplement the content of this class.

This webpage is a “living syllabus”. All information you need for the class is provided or linked here, and every effort will be made to keep that information up-to-date.

Important Dates

There will be no class on the following day:

  • Mon, Jan 20 (Martin Luther King Day)

The following days are currently scheduled for quizzes and exams. I will announce any changes to this schedule both in-class and on Piazza.

  • Fri, Jan 31 – Quiz #1
  • Fri, Feb 14 – Midterm
  • Mon, Mar 2 – Quiz #2
  • Tues, Mar 17, 2:00–3:50pm – Final Exam

Slides and Code Examples

Slides and code examples from the lectures will be posted below, usually shortly before/after class. I may continue to update the slides for each stage of the course until we are done with that stage.

For the first few weeks, I’ll also assign reading from Brent Yorgey’s excellent Intro to Haskell.

Slides Reading Additional files
Jan 6 Course Introduction Ch. 1 Doctest.hs
Jan 8–29 Functional Programming Ch. 2–4 Basics.hs, TypeExercises.txt, TypesPractice.hs
Jan 29–Feb 5 Syntax Sentence.hs, StackLang.hs
Feb 5–21 Semantics IntBool.hs, StackLang.hs, While.hs, Let.hs
Feb 24–26 Types IntBool.hs, Imp.hs
Mar 2–6 Scope and Parameter Passing Param.hs
Mar 9–13 Logic Programming hobbits.pl

Homework Assignments and Course Project

Homework assignments and project submissions are submitted through TEACH. Log in and click “Submit Assignment” in the navigation bar on the right, located under “Class Tools”. You should see a list of currently open submissions.

Please note that late homework may not be accepted. Be sure to submit your assignment on time!

Course Learning Objectives and Course Content

At the end of the course, students should be able to:

  • Create functional programs using algebraic data types and recursive functions.

  • Produce and explain the type and result of an expression in the context of functional programming.

  • Produce an abstract syntax for a language given its concrete syntax.

  • Create a denotational semantics for a language given its abstract syntax and an informal specification of its behavior.

  • Produce and explain the behavior of a program under static vs. dynamic typing, and discuss the benefits and drawbacks of each approach.

  • Produce and explain a program’s output under static vs. dynamic scoping of names.

  • Produce and explain a program’s output under different parameter passing schemes, such as call-by-value vs. call-by-name vs. call-by-need.

  • Create logic programs and express queries using predicates.

With these objectives in mind, the course will cover the following topics:

  • Functional programming in Haskell (~2.5 weeks)
  • Abstract and concrete syntax (~1 week)
  • Introduction to denotational semantics (~2.5 weeks)
  • Static and dynamic type systems (~1 week)
  • Naming, scope, and parameter passing schemes (~1 week)
  • Logic programming in Prolog (~2 weeks)

Accommodations for Students with Disabilities

Accommodations for students with disabilities are determined and approved by Disability Access Services (DAS). If you, as a student, believe you are eligible for accommodations but have not obtained approval please contact DAS immediately at 541-737-4098 or at http://ds.oregonstate.edu. DAS notifies students and faculty members of approved academic accommodations and coordinates implementation of those accommodations. While not required, students and faculty members are encouraged to discuss details of the implementation of individual accommodations.