6.S050 Programming Language Design

Introduction to programming language design. Students will learn about the features used in modern programming languages. This class will prepare students to design their own languages and to become better programmers by understanding their language of choice more deeply. Topics covered include functional programming, data abstraction, modularity, types, memory management, and concurrency.

Credits & Prerequisites

Units: 3-0-9

Prerequisites: none

Meeting Times

Lectures 1pm-2:30pm Tuesday & Thursday in 56-154

Office hours

See Piazza for updated times

Teaching Staff

Learning Objectives

In this course, students will learn about programming languages by examining their various features and design choices. Students will engage with questions such as:

  • What makes a programming language well or ill-suited for a given domain?
  • How do programming language features interact? Can they be composed freely, or not?
  • What are the key design choices faced by programming language designers?
  • How can a language designer encourage the writing of correct programs? Efficient programs?

Syllabus

  • Syntax
    • Concrete vs abstract syntax
    • S-expressions
  • Naming
    • Parameter passing (call-by-value vs call-by-name)
    • Scoping
      • Static
      • Dynamic
      • Non-hierarchical
    • Namespaces
  • Matlab (global scope) & JavaScript (let vs var) case study
  • Control
    • Error handling with monads and exceptions
    • Coroutines & iterators
    • Backtracking
  • Prolog case study
  • Types
    • Simple types
    • Polymorphism
    • Subtyping & ad-hoc polymorphism
  • Rust case study
  • State
    • Simulating mutable state with monads
    • Mutable references
    • Memory management
      • Garbage collection
      • Scope based deallocation/regions
      • Explicit allocation/arenas
  • Data representation
    • Sums & products
    • Pattern matching
    • Objects & closures
  • Haskell case study
  • Data abstraction
  • Modules

Schedule

Date Subject Assignments
Tue, Feb 7 Course intro. (slides)  
Thu, Feb 9 Syntax (notes, slides)  
Tue, Feb 14 Syntax cont. (notes, slides)  
Thu, Feb 16 Big-step semantics (notes, slides) Reading response 1 due
Tue, Feb 21 No class—Monday schedule  
Thu, Feb 23 Small-step semantics (notes, slides) Problem set 1 due
Tue, Feb 28 Functional languages (notes, slides)  
Thu, Mar 2 Naming (slides, examples, notes) Reading response 2 due
Tue, Mar 7 Naming cont.  
Thu, Mar 9 Control (slides, notes) Problem set 2 due
Tue, Mar 14 Control cont. (slides)  
Thu, Mar 16 Generators, coroutines & concurrency (notes, slides) Reading response 3 due
Tue, Mar 21 Types (notes, slides)  
Fri, Mar 24   Problem set 3 due
Thu, Mar 23 Types cont.  
Tue, Mar 28 No class—spring break  
Thu, Mar 30 No class—spring break  
Tue, Apr 4 Gradual typing (notes, slides)  
Thu, Apr 6 Type reconstruction (notebook)  
Tue, Apr 11 State (slides, notes)  
Thu, Apr 13 State cont. (slides) Reading response 4 due
Tue, Apr 18 State cont. Problem set 4 due
Thu, Apr 20 Reasoning about Effects (slides)  
Tue, Apr 25 Data Representation (slides)  
Thu, Apr 27 Modularity with Objects (notes) Reading response 5 due
Tue, May 2 Existential Types (notes)  
Thu, May 4 Monads (slides) Problem set 5 due
Tue, May 9 Metaprogramming (notebook, rendered)  
Thu, May 11 Guest lecture: "Making OCaml Safe for Performance Engineering", Ron Minsky (32-D463)  
Tue, May 16 Wrap-up Problem set 6 due

Grading

Assignment Percentage
Problem Set 1-6 15% each
Reading responses 10%

Peer Feedback

Part of each problem set starting from problem set 2 will be providing feedback on your classmates work. That is, in problem set 2, you'll be giving feedback on a classmate's design from problem set 1. You will be graded on the quality of the feedback you write, but not on your classmate's assessment of your work. We will discuss peer feedback in more detail in class and in the problem set handouts.

Late Policy

Homework is due at 11:59pm (EST) on the day listed on the schedule. Late homework will be accepted with a 10% grading penalty per day, for up to 3 days.

Extensions

If you find that you need an extension, contact one of the course staff before the assignment is due. You can expect to receive a 24-hour extension as long as you contact us. If you need a longer extension, get in touch, and we'll work something out with you.

Collaboration

You may (and are encouraged to!) discuss course content with your classmates, but you may not collaborate on the problem sets. This means that any code or text you write must be solely your own work.

Academic Integrity

In this course, we will hold you to the high standard of academic integrity expected of all students at the Institute. We do this for two reasons. First, it is essential to the learning process that you are the one doing the work. We have structured the assignments in this course to enable you to gain a mastery of the course material. Failing to do the work yourself will result in a lesser understanding of the content, and therefore a less meaningful education for you. Second, it is important that there be a level playing field for all students in this course and at the Institute so that the rigor and integrity of the Institute’s educational program are maintained.

Violating the Academic Integrity policy in any way (e.g., plagiarism, unauthorized collaboration, cheating, etc.) will result in official Institute sanction. Possible sanctions include receiving a failing grade on the assignment or exam, being assigned a failing grade in the course, having a formal notation of disciplinary action placed on your MIT record, suspension from the Institute, and expulsion from the Institute for very serious cases.

Please review the Academic Integrity policy and related resources (e.g., working under pressure; how to paraphrase, summarize, and quote; etc.) and contact me if you have any questions about appropriate citation methods, the degree of collaboration that is permitted, or anything else related to the Academic Integrity of this course.

Additional Reference Material

None of these books are required material for the course, but you might find them useful:

Disability Accommodations

If you need disability-related accommodations, we encourage you to meet with one of the course instructors early in the semester. If you have not yet been approved for accommodations, please contact Student Disability Services at sds-all@mit.edu.

We look forward to working with you to assist you with your approved accommodations.

Diversity

MIT values an inclusive environment. We hope to foster a sense of community in this classroom and consider this classroom to be a place where you will be treated with respect. We welcome individuals of all backgrounds, beliefs, ethnicities, national origins, gender identities, sexual orientations, religious and political affiliations – and other visible and invisible differences. All members of this class are expected to contribute to a respectful, welcoming, and inclusive environment for every other member of the class. If this standard is not being upheld, please feel free to speak with one of the instructors.

Last updated: 2023-05-11 Thu 11:06