TAL

 

home1gif.gif (1270 bytes)    

The TAL Project

Gregg Morrisett
Department of Computer Science
Cornell University
jgm@cs.cornell.edu

Manifesto    Papers     Implementation     Project Members     Related Projects

The TAL Manifesto

Statically typed intermediate languages are effective tools for staging the compilation of high-level languages. Types express invariants that help programmers understand their programs and strongly typed languages prevent many common programming errors. Compiler writers can use these properties to debug sophisticated program transformations such as closure conversion and optimizations such as datatype specialization. Moreover, many of these optimizations are not only type-preserving but actually type-directed; the type of an object guides its translation.

The goal of the TAL project is to extend the paradigm of type-directed compilation to its limit. We compile a high-level language (KML) which includes higher-order polymorphic functions, datatypes, modules, functors, objects, and subtyping through a series of typed intermediate languages and finally into a Typed Assembly Language (TAL). Unlike any other compiler, we not only use typed intermediate languages but also typed target languages.

TALC, our compiler, generates code for the Intel 386 family of assembly languages which is then verified by our type checker before being assembled by the MASM assembler. The few typing annotations on the code are comments which are erased during the assembler's translation. The assembly language type system is powerful enough to express high-level abstractions such as closures and abstract datatypes and yet flexible enough to permit traditional low-level optimizations such as loop invariant removal, strength reduction, and redundant move elimination.  Furthermore, just as the more familiar typed source and intermediate languages catch programmer errors, so does our typed assembly language. It helps to ensure that complicated backend transformations such as the optimizations above as well as register allocation and more general instruction selection and scheduling are performed correctly.

The type soundness of our assembly code implies many important security properties such as memory safety. As a result, our assembly code is a form of proof-carrying code. TAL applets, like Java applets, may be downloaded from untrusted sources on the internet, verified, and executed safely without fear they will corrupt the host machine.   Furthermore, because TAL is assembly language, there is no interpretation overhead and no just-in-time compiler to run or trust.

The present TAL effort has many applications in the security and compilation domains. Future work involves compiling more expressive typed languages into the language of real machines. We seek to reveal the connections between the typed lambda calculi which give semantics to many modern languages and the Von Neumann machines which implement them.

TAL Papers

Greg Morrisett, Karl Crary, Neal Glew, and David Walker. Stack-Based Typed Assembly Language. To appear in 1998 Workshop on Types in Compilation.  (abstract, postscript, dvi)
Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to Typed Assembly Language. In Twenty-Fifth ACM Symposium on Principles of Programming Languages. pages 85-97, San Diego, January 1998. (abstract, postscript, dvi)
Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to Typed Assembly Language (Extended Version). Technical Report TR97-1651, Cornell University, November 1997.  (abstract, postscript, dvi)

TALC Implementation

We are currently implementing a compiler for the KML programming language which generates TAL code. Futurereleases of the compiler will be available from this site. For now, take a look at the following example factorial program and the corresponding TAL code that our compiler generates.

TAL Project Members

Karl Crary
Neal Glew (who needs a web page)
Greg Morrisett
David Walker
Stephanie Weirich
Steve Zdancewic

Related Projects

Security
Java
Proof-Carrying Code
Tacoma
Compilers
The Church Project
Flint & SML/NJ
ML-Kit with Regions
O'Caml
TILT

This page is maintained by walker@cs.cornell.edu, last updated on 12 February 1998.