From Scripts to Programs

Matthias Felleisen

Like it or not, dynamic scripting languages have become as popular as static programming languages. Currently popular examples are Javascript, Perl, Python, and Ruby; alternatives emerge on a frequent basis. Most of these scripting languages are untyped and have a flexible semantics for primitive operations. A lot of programmers find these attributes appealing for creating 'throw away' programs and for prototyping products, and they use scripting languages for just these reasons. The reflective programmers among them are also beginning to notice, however, that when small untyped scripts grow large and old, maintaining them becomes difficult. A lack of types means that programmers must (re)discover critical pieces of design information every time they wish to change or improve a program.

My team and I have therefore embarked on a research program that aims to solve this large and growing engineering problem with a combination of experience and tools from academic programming language research. In this talk I will present the first milestone: Typed Racket, an explicitly typed extension of Racket, a Scheme-like scripting language. Using Typed Racket, programmers can add types to a code base on a module by module basis. Two factors make such transformations straightforward and useful. First, the type system is highly flexible, combining numerous academic results with the novel notion of occurrence typing. Second, the type system uses Findler's higher-order contracts to make the integration of typed and untyped modules safe.

Collaborators: Sam Tobin-Hochstadt, Vincent St-Amour