‹Programming› 2024
Mon 11 - Fri 15 March 2024 Lund, Sweden
Thu 14 Mar 2024 15:00 - 15:30 at M:Teknodromen - Research Paper 6 Chair(s): Stefan Marr

Context. In the first part of his 2012 presentation “Inventing on Principle”, Bret Victor gives a demo of a live code editor for Javascript which shows the dynamic history of values of variables in real time. This form of live programming has become known as “probes”. Probes provide the programmer with permanent and continuous insight into the dynamic evolution of function or method variables, thus improving feedback and developer experience.

Inquiry. Although Bret Victor shows a working prototype of live probes in the context of Javascript, he does not discuss strategies for implementing them. Later work provides an implementation approach, but this requires a programming language to be implemented on top of the GraalVM runtime. In this paper we present LiveRec, a generic approach for implementing probes which can be applied in the context of many programming languages, without requiring dedicated compiler or runtime support.

Approach. LiveRec is based on reusing existing debug protocols to implement probes. Methods or functions are compiled after every code change and executed inside the debugger. During execution the evolution of all local variables in the current stack frame are recorded and communicated back to the IDE for display to the user.

Knowledge. It turns out that debug protocols are rich enough for implementing live probes. Step-wise execution, code hot swapping, and stack frame inspection provide the right granularity and sufficient information to realize live probes, without modifying compilers or language runtimes. Furthermore, it turns out that the recently proposed Debugger Adapter Protocol (DAP) provides an even more generic approach of implementing live probes, but, in some cases, at the cost of a significant performance penalty.

Grounding. We have applied LiveRec to implement probes using stack recording natively for Java through the Java Debug Interface (JDI), and through the DAP for Java, Python, C, and Javascript, all requiring just modest amounts of configuration code. We evaluate the run-time performance of all four probes prototypes, decomposed into: compile-after-change, hotswap, single step overhead, and stack recording overhead. Our results show that live probes on top of native debug APIs are performant enough for interactive use. In the case of DAP, it depends on characteristics of the programming language.

Importance. Live programming improves the programmer experience by providing immediate feedback about a program’s execution and eliminating disruptive edit-compile-restart sequences. Probes are one way to shorten the programmer feedback loop at the level of functions and methods. Although probes are not new, and have been implemented in (prototype) systems, LiveRec’s approach of building live probes on top of existing and generic debug protocols opens up probes for a host of mainstream programming languages, with minimum effort.

Thu 14 Mar

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change

15:00 - 16:30
Research Paper 6Research Papers at M:Teknodromen
Chair(s): Stefan Marr University of Kent
15:00
30m
Talk
LiveRec: Prototyping Probes by Framing Debug ProtocolsVol. 8
Research Papers
Jean-Baptiste Döderlein ENS Rennes, Riemer van Rozen CWI, Tijs van der Storm CWI & University of Groningen
Link to publication DOI
15:30
30m
Talk
Collective Allocator Abstraction to Control Object Spatial Locality in C++Vol. 8
Research Papers
Takato Hideshima The University of Tokyo, Japan, Shigeyuki Sato The University of Electro-Communications, Tomoharu Ugawa University of Tokyo
Link to publication DOI
16:00
30m
Talk
Scheduling Garbage Collection for Energy Efficiency on Asymmetric Multicore ProcessorsVol. 8
Research Papers
Marina Shimchenko Uppsala University, Tobias Wrigstad Uppsala University, Erik Österlund Oracle
Link to publication DOI