Compiling Python via OCaml
Presenter: Raj Bandyopadhyay <rajb@rice.edu>
Author: Raj Bandyopadhyay, Walid Taha, Ken Kennedy, (rajb,taha,ken).AT.rice.edu
Affiliation: Rice University
ABSTRACT
Dynamic languages like Python have gained significant popularity in mainstream programming. To support their dynamic features, they are often interpreted. In scientific computing applications, this works well for prototyping, but often means that significant efforts must later be invested in building the "real" application. Our thesis is that dynamic languages like Python can be effectively compiled by translation to statically typed functional languages like OCaml. Not only that, but this approach is highly amenable to formal verification. This, in fact, entails developing a formal semantics for the dynamic language. The talk describes ongoing efforts to demonstrate this strategy in the concrete case of compiling Python using OCaml. After explaining why statically typed functional languages like OCaml may play an important role in compiling dynamic languages, we describe our progress to date in understanding the semantics of Python and in devising a correct translation into OCaml. At the time of writing this abstract, preliminary performance measurements were quite encouraging.
Raj Bandyopadhyay is a graduate student at Rice University, working with Dr. Ken Kennedy and Dr. Walid Taha.