Course Information

Overview Description:

This course is about the principles of programming languages.  It studies programming language concepts by implementing a sequence of interpreters, compilers, and type checkers, each one introducing a new language concept.  The goal of this course is threefold: By studying the concepts and abstractions of high-level programming languages, students should be able to use them more effectively. Second, by learning how the features of high-level programming languages are implemented, students should be able to program more expressively in low-level languages.  Finally, by understanding the principles behind programming language design, students should be able to to create, evaluate and compare programming languages.

Detailed Description

CSE 340 consists of 3 parts:

The first part focuses on specifying the syntax and the semantics of programming languages. The former is introduced via simple parsing (translations) of program text into abstract syntax. Topics like lexical analysis and advanced parsing methods are left to CS 341, a course on compilers. The semantics of a rich variety of programming language constructs is specified using interpreters and reduction systems. The constructs include arithmetical and conditional expressions, blocks, lexically-scoped first-class functions, simple modules and objects, and control constructs (loop exits, first-class continuations, simple threads).

The second part illustrates how interpreters can be used to analyze the behavioral properties of programming languages. Two examples are covered: type safety and memory safety. Type safety guarantees that programs respect syntactically defined type abstraction boundaries and never raise certain classes of error signals. Memory safety guarantees that programs release memory only if it is provably useless for the remainder of the evaluation.

The third part shows how interpreters can systematically be transformed so that they use fewer and fewer language facilities. The key transformations are the explicit representation of closures as records and the conversion of program control flow to continuation-passing style.  Using these transformations, a recursive interpreter can quickly be be re-written in a low-level language like C/C++ or assembly language.  These transformations can be applied both to interpreters and to arbitrary programs.  The process of applying these transformations to arbitrary input programs is a high-level description of program compilation, a process which is explored in more detail in CS 341.

Grading Policy:

Grading components:

  • Homework assignments  30%

    Homework assignments will be available on the web pages.  They are to be completed independently and turned one hour before the beginning of class on the due date.  Late homework will not be accepted without prior permission of the instructor unless there are emergency circumstances. Homework assignments will receive a grade of check plus, check, check minus or zero.

  • Midterm exam  30%

    The midterm will be given in class on March 5th. It will cover the first half of the course.
  • Final exam 30%

    The final will be given at the time and date determined by the registrar.  It will cover the second half of the course.
  • Class Participation 10%


  • Class participation is determined subjectively, based on questions asked or answered in class or in the course newsgroup.

Requests for regrades on any assignment or exam must be submitted within one week.

The final course grades will be determined by these components. The distribution of grades will be similar to other courses at this university. However, I reserve the right to adjust final grades based on subjective assessment.

Academic Integrity Policy

You are permitted to discuss the homework problems with other class members with the following limitations. These discussions are to be limited to high-level concepts. You are not permitted to copy or share written work or implementation details. It is understood that the work that you submit may be based on these discussions but has not been either copied directly from another student's paper nor is it, in part or in whole, the product of impermissible collaboration.

I take academic integrity very seriously and will not tolerate violations in my class.  Please read the Code of Academic Integrity for the University of Pennsylvania. If you are unsure of your actions contact me for clarification.

last modified: 6-jan-03