Incremental Live Programming via Shortcut Memoization

πŸ“… 2026-03-19
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This work addresses the high re-execution overhead faced by live programming systems under frequent edits. We present Chordata, the first incremental interpreter supporting languages with arbitrary rewrite semantics, which leverages a novel shortcut memoization mechanism to learn and reuse recurring computation patterns from prior executions. We formalize this mechanism and provide a mechanized correctness proof by embedding the Hazel system into a CEK abstract machine framework. Additionally, we design heuristic strategies to efficiently identify high-value shortcuts. Experimental evaluation demonstrates that Chordata achieves an average speedup of 13.03Γ— (with a 19.97Γ— memory overhead) on student programming traces, with particularly pronounced gains for small edits, complex programs, and large inputsβ€”even enabling acceleration within a single execution.

Technology Category

Application Category

πŸ“ Abstract
Live programming systems aim to quickly show programmers the dynamic impacts of program edits. To do so, they re-execute the program whenever it is edited, which poses a computational challenge when programs become large or complex. This has led to the need for incrementality in the implementation of live program interpreters. This paper introduces Chordata, an incremental program interpreter based on shortcut memoization, which learns repeated patterns of computation, called shortcuts, by observing executions of previous versions of a program. It can then apply these shortcuts when the same or a structurally similar program fragment is re-executed. This paper contributes a formal semantics of shortcut memoization for any language with a rewrite-based semantics, with mechanized proofs of key correctness properties. We then express a variant of the Hazel live programming system, expressed as a CEK machine, in Chordata, and develop a number of practical heuristics to learn high-value shortcuts. We evaluate the resulting system on editing traces of students solving simple programming problems. Chordata achieves a speedup of 13.03\times compared to baseline with a 19.97\times memory overhead. For smaller changes and for more complex programs, Chordata achieves even greater speedups. Furthermore, we show that Chordata is capable of providing a speedup even within a single execution, with a faster speedup on a larger input.
Problem

Research questions and friction points this paper is trying to address.

live programming
incremental computation
program execution
computational overhead
dynamic impact
Innovation

Methods, ideas, or system contributions that make the work stand out.

incremental live programming
shortcut memoization
program interpretation
execution reuse
CEK machine
πŸ”Ž Similar Papers
No similar papers found.