16.01.2015 Views

CS2013-final-report

CS2013-final-report

CS2013-final-report

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

esults from programming language theory. To take another example, modern languages such as ML (and proposed<br />

extensions of Java) include what are known as parameterized types to support flexible code re-use. Parameterized<br />

types complicate compilers considerably because they must account for situations in which the type of a variable or<br />

function argument is not known at compile time. The most effective methods for handling parameterized types rely<br />

on typed intermediate languages with quite sophisticated type systems. Here again programming language theory<br />

provides the foundation for building such compilers.<br />

Programming language theory has many applications to programming practice. For example, “little languages” arise<br />

frequently in software systems -- command languages, scripting languages, configuration files, mark-up languages,<br />

and so on. All too often the basic principles of programming languages are neglected in their design, with all too<br />

familiar results. After all, the argument goes, these are “just” scripting languages, or “just” mark-up languages, why<br />

bother too much about them One reason is that what starts out as “just” an ad hoc little language often grows into<br />

much more than that, to the point that it is, or ought to be, a fully-fledged language in its own right. Programming<br />

language theory can serve as a guide to the design and implementation of special purpose, as well as general<br />

purpose, languages.<br />

Another application of the theory of programming languages is to provide a rigorous foundation for software<br />

engineering. Formal methods for software engineering are grounded in the theory of specification and verification.<br />

A specification is a logical formula describing the intended behavior of a program. There are all kinds of<br />

specifications, ranging from simple typing conditions (“the result is a floating point number between 0 and 1”) to<br />

complex invariants governing shared variables in a concurrent program. Verification is the process of checking that<br />

the implementation indeed satisfies the specification. Much work has gone into the development of tools for<br />

specifying and verifying programs. Programming language theory makes precise the connection between the code<br />

and its specification, and provides the basis for constructing tools for program analysis.<br />

The theory of programming languages provides a “reality check” on programming methodology, that part of<br />

software engineering concerned with the codification of successful approaches to software development. For<br />

example, the merits of object-oriented programming for software development are well known and widely touted.<br />

Object-oriented methodology relies heavily on the notions of subtyping and inheritance. In many accounts these two<br />

notions are confused, or even conflated into one concept, apparently because both are concerned with the idea of one<br />

class being an enrichment of another. But careful analysis reveals that the two concepts are, and must be, distinct:<br />

confusing them leads to programs that violate abstraction boundaries or even incur run-time faults.<br />

The purpose of this course is to introduce the basic principles, methods, and results of programming languages to<br />

undergraduate students who have completed the introductory sequence in computer science at Carnegie Mellon. I<br />

intend for students to develop an appreciation for the benefits (and limitations) of the rigorous analysis of<br />

programming concepts.<br />

The development is based on type theory, a general theory of computation that encompasses all aspects of<br />

programming languages, from the data with which we compute to the means by which we structure programs.<br />

Programming language “features” are viewed as manifestations of type structure. Basic data structures such as<br />

tuples arise as product types, trees and graphs arise as recursive types, and procedures arise as monadic function<br />

types. Each language concept is defined by giving its statics, which specify how it interacts with other parts of a<br />

program, and its dynamics, which specifies how it is executed on a computer. Type safety is the coherence of the<br />

statics with the dynamics; safety is proved as a mathematical theorem governing each language feature. The<br />

specific topics vary from one semester to the next, but the course typically covers finite and infinite data structures,<br />

higher-order functions, continuations, mutable storage, data abstraction and polymorphism, so-called dynamic<br />

typing, parallel computation, laziness, and concurrency, all presented in a single unifying framework.<br />

What is the format of the course<br />

Two 80 minute lectures per week, one 60 minute recitation, plus office hours with either the teaching assistants or<br />

the professor or both.<br />

- 381 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!