Back to 2015-proposals

Title: Language integration and migration
Proposer: Laurence Tratt
Type: Tutorial
Duration: 90 mins
Description:
Programming languages are islands, each disconnected from the rest. We choose a language for a task and, for better or worse, stick with it. Communicating between programs written in different languages is such a slow, arduous, task that we avoid doing it whenever possible.

In this tutorial I will show how language composition can lower, and even remove, the barriers between languages, using compositions of 1) Python and Prolog and 2) Python and PHP as concrete examples. We have pioneered new approaches to the two major challenges in language composition: editing and running composed programs.

Using our novel editor 'Eco', users can write PHP source files that can contain Python functions wherever PHP functions are valid. In other words, users can mix the two languages even within a single file. The two languages can be intertwined in surprising ways. For example, variable scopes are defined across the languages.

We then run programs upon a composed meta-tracing VM. Our results suggest that performance of composed PHP + Python programs not only exceeds that of the standard php.net interpreter, but is often competitive with high performing mono-language VMs.

I will conclude by examining the possible uses of a PHP and Python composition. For example, as well as making languages first-class elements, language composition offers the potential to gradually migrate a system written in a legacy language to a new language. In other words, rather than rewriting everything from scratch, one can migrate small sections at a time to a different language, while maintaining good performance.