### ECS 240 PROGRAMMING LANGUAGES (4) II

**Lecture:** 3 hours

**Discussion:** 1 hour

**Prerequisite:** Courses ECS 140A, ECS 142

**Grading:** Letter; problem sets (10%), project (30%), midterm (20%), final (40%)

**Catalog Description:**

Advanced topics in programming languages, including formal syntax and semantics, the relation between formal semantics and verification, and an introduction to the lambda calculus. Additional topics will include language design principles, alternative programming language, in-depth semantic theory and models of language implementation.

**Expanded Course Description:**

Lectures provide an introduction to the theoretical side of the study of computer programming languages, including language definition methods and the lambda calculus. The usefulness of advanced language features in appropriate programming applications is also discussed, with examples. The project gives students an opportunity to experiment with defining and prototyping a programming language.

The lectures topics include the following, not necessarily listed in chronological order:

- Motivation for Formal Language Definition
- Standardization, program portability, program verification
- Rapid prototyping, language implementation

- Overview of Language Definition Methods
- Axiomatic, operational, algebraic, attribute-grammar, denotational
- Applicability, equivalence proofs

- Criteria for Language Definitions
- Consistency, completeness, non-circularity, exceptions

- Standard Concepts in programming Language Definition
- Abstract syntax, syntax-driven definition, referential transparency
- Semantic domains: State, environment, store, etc.
- Continuations

- Applications of Denotational Semantics
- Least fixed points, while loops, recursive programs

- The Lambda Calculus
- Lambda notation, alpha-beta-and eta-reduction, normal order reduction
- The Y fixed-point combinator
- Curry, Scott, and the semantics of the lambda calculus
- The Lambda calculus as the basis of the definition and implementation of functional languages

- Programming Languages and the Lambda Calculus
- Currying, functions as first class objects, lazy and eager evaluation
- LISP, Scheme, ML

- Applications of Advanced Language Features
- Data abstraction, polymorphism and type inference
- Currying, functions as first class objects, lazy and eager evaluation

- Optional Additional Topics: Language Design
- Language features and intended application
- Syntax

- Optional Additional Topics: Alternative Programming Styles
- Dataflow, logic, distributed, and/or concurrent languages, etc.

- Optional Additional Topics: Language Theory
- Reflection, strictness analysis, abstract interpretation
- Graph reduction, combinators

- Programming Language Implementation Models
- Implementation of imperative languages
- Implementation of functional languages (e.g. ML)
- Implementation of logic-based languages (e.g. Prolog)
- Special topics: heap allocation, garbage collection

**Textbooks:**

B. Meyer, *Introduction to the Theory of Programming Languages, *Prentice Hall, 1991.

J. Ullman, *Elements of ML Programming, *Prentice Hall, 1994.

**Programming Project:**

The students will apply the concepts of the class to a real programming language, for which they will create the following: informal requirements, formal syntax, formal semantics, an interpreter, and a verification system for a subset of the language which will be used to verify a few sample programs. The students will demonstrate that this rigorous approach to language design and implementation produces a rugged and easily modifiable system, an important concept in making language design and implementation an engineering discipline.

**Engineering Design Statement:**

The project involves the design, implementation, and testing of a programming language. The facilities used for these programming projects resemble those that would be found in industry to the extent possible, given the academic constraints. The project assignment defines performance specifications and constraints, and outlines a general approach to the problem. However, design and implementation details are left to the students. Lectures discuss general concepts of programming languages and design choices available to programmers, in terms of algorithmic design, what language features can be employed to solve a particular problem, and what languages are most appropriate for particular application domains. Projects are graded based on the design and performance, including documentation. Examination questions are based on design methods discussed in lecture and from the project.

**ABET Category Content:**

Engineering Science: 2 units

Engineering Design: 1 unit

**Instructor:** K. Levitt, R. Pandey

**Prepared by:** K. Levitt (Feb. 1977)

**THIS COURSE DOES NOT DUPLICATE ANY EXISTING COURSES **

Revised: 2/97