SCS Undergraduate Thesis Topics
|Mark Hahnenberg||Jonathan Aldrich||Dynamic Casts in the Plaid Programming Language|
Typestate is a new paradigm in programming language design that allows programmers to explicitly specify state transitions, which include the addition and removal of the fields and methods of objects at runtime, within their programs. Plaid, a general-purpose programming language in development at Carnegie Mellon, reifies this idea of typestate in an actual implementation. In Plaid, object aliasing complicates the static verifcation of state transitions by making it impossible to know with certainty the state of all other objects after a transition has been performed . Plaid solves this issue with permission kinds, which help programmers as well as the compiler reason about aliasing in programs. In most languages, runtime or dynamic casts must be introduced either explicitly by the programmer or implicitly by the compiler at certain points in a program in order to ensure that the language is typesafe. The addition of aliasing information to a gradual type system raises several issues in the implementation of these casts. In order to cast something to a type with a speci c permission, aliasing information must be maintained at runtime to verify that the resulting permission is compatible with all other existing permissions for that object. For my thesis I defined a static and dynamic semantics for dynamic casts in the Plaid programming language, incorporated these semantics into the Plaid compiler implementation, and examined the impact of this implementation on the overall performance of compiled Plaid programs.