roly perera: interactive programming

http://dynamicaspects.org
Supervisor: Paul Levy

My research is about interactive programming. Interactive programming is a new way of implementing declarative languages. The basic idea is to treat the evaluation of a closed term not as a transient activity that yields a single value, but as a persistent structure which responds to changes like a spreadsheet. The process of building this structure is analogous to reduction in a traditional language. External agents can interact with the structure, causing the system to adjust into a different state embodying a new computation. "Writing a program" in this paradigm is to start with a null computation and manipulate it into the desired computation, blurring the familiar distinctions between compile-time and run-time, programmer and end-user, and development tool and application.

The basic idea is to identify the state of an interactive system with the evaluation of a (possibly higher-order) functional program. An interaction with the system then consists of an external agent mutating this program, for example by modifying the argument part or the function part of an application, and the system responding by transitioning to a new state representing the evaluation of the modified program.

In effect the language runtime provides external agents with the ability to explore nearby variants of the program without re-executing the whole thing from scratch. Programs no longer run once and then disappear, but hang around so that they can be interacted with.

A central benefit is that the synchronisation of state in response to interaction is an automatic feature, rather than something which has to be explicitly coded. This makes programming easier, and removes the layer of imperative I/O otherwise needed to make functional programs interact. Instead, any change in the value of a program constant counts as an input, and any change in a computed value as an output. This is nicely illustrated by a feature called "dynamic interactivity" which appeared in version 6 of Mathematica.

Interactive languages are "spreadsheets all the way down". This contrasts with a traditional spreadsheet, where the execution of a formula has no observable internal structure. The persistence of the structure has two important consequences. First, there is the potential to reuse parts of it when computing the new state. In fact, this is essential to an efficient implementation. This connects my research to the incremental computation literature, in particular the self-adjusting computation of Acar et al.

The second consequence of persistence is that the full history of a computation is available for debugging: one can simply inspect the structure to see why the computation produced the value it did. This idea has been explored by Jonathan Edwards in the experimental interactive language Subtext.

Other stuff Here are the slides from a talk I gave at PADL 2010. Some more waffle is here.

You can email me at rnp@cs.bham.ac.uk
or roly.perera@dynamicaspects.org. I'm in room 145.

Conference and workshop papers

Perera, R. 2010. First-order interactive programming. M. Carro and R. Peña, editors. PADL 2010: Proceedings of the 12th International Symposium on the Practical Aspects of Declarative Languages. Volume 5937 of Lecture Notes in Computer Science, pp. 186-200. Springer, Heidelberg.

Perera, R. 2008. Programming languages for interactive computing. Proceedings of the 2nd Workshop on the Foundations of Interactive Computation, Braga, Portugal. Electronic Notes in Theoretical Computer Science, Elsevier.

Perera, R., Foster, J. and Koch, G. 2005. A delta-driven execution model for semantic computing. OOPSLA '05: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, San Diego, CA, USA, pp. 63-71. ACM Press, New York.

Technical reports

Perera, R. 2009. A First-Order Interactive Programming Language Technical Report CSR-09-09, University of Birmingham, School of Computer Science, November 2009.

Perera, R. 2009. Interactive Programming Technical Report CSR-09-05, University of Birmingham, School of Computer Science, June 2009. This paper also appeared in Draft Proceedings of 10th Symposium on Trends in Functional Programming, TFP 2009. Komarno, Slovakia, 2-4 June 2009.

Extended abstracts

Perera, R. 2004. Refactoring: to the Rubicon...and beyond! OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, Vancouver, BC, Canada, pp. 2-3. ACM Press, New York.