Broadening the View of Live Programmers: Integrating a Cross-Cutting Perspective on Run-Time Behavior into a Live Programming Environment

Patrick Rein,Christian Flach,Stefan Ramson,Eva Krebs,Robert Hirschfeld
DOI: https://doi.org/10.22152/programming-journal.org/2024/8/13
2024-03-05
Abstract:Live programming provides feedback on run-time behavior by visualizing concrete values of expressions close to the source code. When using such a local perspective on run-time behavior, programmers have to mentally reconstruct the control flow if they want to understand the relation between observed values. As this requires complete and correct knowledge of all relevant code, this reconstruction is impractical for larger programs as well as in the case of unexpected program behavior. In turn, cross-cutting perspectives on run-time behavior can visualize the actual control flow directly. At the same time, cross-cutting perspectives are often difficult to navigate due to the large number of run-time events.
Programming Languages
What problem does this paper attempt to address?
### What problems does this paper attempt to solve? This paper aims to solve the limitations encountered by Live Programming Environments when dealing with more complex and larger - scale programs. Specifically, live programming environments usually provide a local perspective, that is, they feedback the dynamic behavior of the program by visualizing the specific runtime values of expressions or statements. However, this local perspective requires programmers to reconstruct the control flow in their minds when understanding the program behavior, which becomes impractical when facing larger or more complex programs. #### Limitations: 1. **Limitations of the local perspective**: When the program becomes more complex, it is difficult to understand the interactions between multiple methods relying solely on the local perspective. 2. **Difficulties in debugging**: During the debugging process, the local perspective cannot clearly show the incorrect control flow, causing programmers to need to switch to other tools, thus losing the advantages of the live programming environment. 3. **Navigation difficulties**: Since the call trace usually contains a large number of events, it is difficult to directly navigate and understand. #### Solutions: To overcome these limitations, the author proposes to integrate the cross - cutting perspective into the live programming environment. The cross - cutting perspective can directly visualize the actual control flow of the program, helping programmers better understand and debug the behavior of complex programs. Specific measures include: - **Integrate call - tree browser**: As a prototype of the cross - cutting perspective, integrate it into the Babylonian/S live programming environment. - **Combine local and cross - cutting perspectives**: Allow programmers to jump from probes in the local perspective to specific call paths in the cross - cutting perspective and vice versa. - **Path indicator and value inheritance visualization**: Directly display the control - flow paths related to probes in the code editor, reducing the need to switch tools. In this way, the author hopes to expand the live programming experience so that it can better support the development and debugging of complex systems. ### Formula examples Although this article mainly involves the design of the programming environment and user experience, if there are formulas involved, I will ensure that they are correctly presented in Markdown format. For example: Suppose we have a function \( f(x)=x^{2}+2x + 1\), in the live programming environment, we can use probes to monitor the output values of \( f(x)\) under different inputs. ```markdown \[ f(x)=x^{2}+2x + 1\] ``` This can ensure the readability and accuracy of the formula.