roly perera: interactive programming

http://dynamicaspects.org
Supervisor: Paul Levy

Programming is an ongoing dialogue between programmer and programming environment. Programming activities are questions. The answers are the feedback provided by the programming environment.

The questions come in two flavours. How (or provenance) questions arise during debugging. How did this result get to be zero? Why was that true rather than false? What if questions concern variants of a program and how they relate to each other, and typically arise during coding, testing and bug-fixing. What value would the program produce for a different input? What value would a different program produce for the same input? The emphasis of the ongoing dialogue often shifts between constructive, diagnostic and remedial.

This “interactive” construal of programming is poorly supported by traditional programming environments. For example when debugging, we often want see the impact of a fix on our current view of the execution of the program. That carefully constructed view isolates a problem, and we want to know if the fix makes the problem go away. Using the terminology we just introduced, we want to ask a “what if” question, and have the answer take the form of a change to the answer to the “how” question we are currently exploring. But to ask a “what if” question, we must usually exit the program, apply the change, and then run the program again from scratch, losing our all-important debugging context.

I'm working on a new kind of tool design which supports these interwoven, interactive Q&A sessions more directly. Instead of restarting the program each time, we update its execution incrementally, allowing our working context to be maintained as we program, rather than forcing us to reconstruct it from scratch each time. I have a prototype implementation called LambdaCalc, after the early spreadsheet systems VisiCalc and SuperCalc. You can learn more about LambdaCalc via my blog.

LambdaCalc is an incremental spreadsheet language, but with familiar functional programming features like recursion, higher-order functions and data types. Cells contain nested spreadsheets, so that all intermediate computations can be explored. A LambdaCalc computation is “spreadsheets all the way down”. Jonathan Edwards explored a similar nested-spreadsheet concept in the programming language Subtext, but without considering many of the features I'm investigating.

LambdaCalc is a proof-of-concept, not a production tool. It is partly self-hosted and so runs very slowly and does not have a GUI performant enough to accept user input. Instead, it provides a zipper-like interface to the program and its execution and a set of browsing and editing combinators which allow interactions of the kind described here to be scripted up in Haskell and executed. It also able to generate the UI state associated with any configuration, which can then be displayed in a window or rendered as a PDF or Postscript file.

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

You can email me at rnp@cs.bham.ac.uk, roly.perera@dynamicaspects.org or rolyp@mpi-sws.org. I'm currently on a 16-month internship at Max Planck Institute for Software Systems.

Under review

Acar, U. A., Ahmed, A., Cheney, J. and Perera, R. 2012. A core calculus for provenance. Invited to Journal of Computer Security (JCS) Special Issue on Conference on Principles of Security and Trust 2012.

Perera, R., Acar, U. A., Cheney, J. and Levy, P.B. 2012. Functional programs that explain their work. Submitted to ICFP 2012.

Conference and peer-reviewed workshop papers

Acar, U. A., Ahmed, A., Cheney, J. and Perera, R. 2012. A core calculus for provenance. Proceedings of the First Conference on Principles of Security and Trust (POST '12). Springer. To appear.

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., 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.

Non-peer-reviewed workshop papers

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.

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.

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.