Lorgnette: Creating Malleable Code Projections
Title of the Paper
lorgnette: Creating Malleable Code Projections
Paper Information
- Subject Area: Programming languages, human-computer interaction design for code editors
- Keywords: lorgnette, projections, semantic interaction, programming tools, user customization, code editors, modifiable interfaces, multi-language support, model-driven engineering, visual programming
Research Background and Problem Statement
-
Identified Problems and Challenges:
- Existing code "projections" (interactive alternative representations of code snippets) are often hardcoded, supporting only specific languages or development scenarios.
- Users' "syntactic interaction" with language symbols often fails to effectively comprehend or manipulate the semantic level of code expressions.
- Current systems supporting projections in programming environments do not allow ordinary users to flexibly create or modify projections, hindering the realization of personalized needs.
-
Significance:
Enhancing the user experience and efficiency of code editors, enabling developers to intuitively view and modify code based on semantic interaction, and lowering the technical barrier so that every developer can participate in tool innovation. -
Research Motivation and Related Work:
- Projections offer users the possibility to view and manipulate code in representations that align better with their mental models.
- Although some frameworks supporting projections exist, such as JetBrains MPS and Visual HDL, these systems are more oriented toward high-cost professional scenarios, have limited multi-language adaptability, and lack usability and malleability for end users.
- As modern programming gradually shifts from operational to exploratory and real-time paradigms, a dynamically customizable, cross-language extensible code projection solution is needed.
Solution
-
Core Method or Solution:
A framework named lorgnette is proposed, allowing users to customize and implement interactive code projections in their code editors. This enables the display of code snippets, different methods of data parsing, and multi-language configurations. -
Innovations:
- Support for Multiple Resource Types: The framework abstracts and supports projections for code text, syntax tree nodes, and runtime information.
- Multi-language and Language-agnostic: It supports direct adaptation to multiple languages and provides projection templates, reducing the cost of extending or migrating to new languages.
- Low Barrier and High Flexibility: Users can decide how to customize, modify, and use projections without always relying on developers.
- Support for Forward and Backward Mapping: User interaction results can be immediately mapped back to the code, enabling bidirectional updates.
-
Implementation Steps and Key Techniques:
- Define methods for detecting and extracting resources from code snippets.
- Use forward mapping to transform resources into models for user interface manipulation.
- Utilize backward mapping to update code resources, ensuring synchronization between code and interface states.
- Provide projection templates to help users quickly generate common interfaces, such as forms, tables, color pickers, etc.
Research Results
-
Specific Outcomes:
- Analyzed 62 projection cases to summarize the characteristics, scope, and requirements of code projections.
- Implemented five practical cases using lorgnette, including a color picker, Markdown table editor, regular expression visualization, variable tracking visualization, and configuration forms, demonstrating its broad adaptability.
-
Comparison with Existing Solutions:
- lorgnette is currently the only framework supporting text, syntax tree, and runtime resources, and one of the few projection development tools fully compatible with multiple languages.
- Compared to other systems (e.g., JetBrains MPS and mage), lorgnette emphasizes user customization freedom, thereby enhancing flexibility and practicality.
-
Experimental or Evaluation Results:
- Demonstrated projection functionality across different languages and diverse use cases.
- In five projection scenario tests, the framework proved capable of supporting both static content (e.g., Markdown tables) and dynamic data processing (e.g., JavaScript variable value tracking), meeting various user needs.
-
Limitations and Future Directions:
- Current Limitations:
- lorgnette has limited capabilities for multi-file interactions (e.g., simultaneous operations on HTML and CSS).
- It does not yet support complex projections for entire programs (e.g., global call graphs).
- The ability to embed document outputs has not been developed.
- Future Improvements:
- Further exploration of more efficient methods for creating bidirectional mappings.
- Support for cross-file and cross-document projection coupling.
- Research on deep integration with collaborative programming and AI coding assistants (e.g., ChatGPT) to help developers iterate code and projections more efficiently.
- Current Limitations:
Research Questions / Practical Problems
Question signals indexed for this paper.
Research Questions
3- How can a framework be designed to enable users to flexibly create and modify interactive code projections in code editors?Category: Code Projection and Visual EditingSimilar questionsarrow_forward
- How can code projection tools support multiple programming languages and lower users' technical barriers?Category: Code Projection and Visual EditingSimilar questionsarrow_forward
- How can forward and backward mapping in code projection efficiently connect user interaction with code synchronization?Category: Code Projection and Visual EditingSimilar questionsarrow_forward
Practical Problems
1- Developers struggle to intuitively view and modify code, and existing projection tools lack flexibility.Category: Code Projection and Visual EditingSimilar questionsarrow_forward
- 100%
Pagebreaks: Multi-Cell Scopes in Computational Notebooks
CHI '25· Knowledge Worker Tools & Workflows +1
- 100%
Using Annotations for Sensemaking About Code
UIST '22· Knowledge Worker Tools & Workflows +1
- 75%
Computational Interaction: Theory and Practice
CHI '18· Computational Methods in HCI
- 75%
Model-based Evaluation of Recall-based Interaction Techniques
CHI '24· Computational Methods in HCI
- 75%
Small-Step Live Programming by Example
UIST '20· Computational Methods in HCI
- 60%
Visualizing API Usage Examples at Scale
CHI '18· Interactive Data Visualization +1
- 60%
Doppio: Tracking UI Flows and Code Changes for App Development
CHI '18· Knowledge Worker Tools & Workflows +1
- 60%
Pointing All Around You: Selection Performance of Mouse and Ray-Cast Pointing in Full-Coverage Displays
CHI '18· Knowledge Worker Tools & Workflows +1
- 60%
Observations on Typing from 136 Million Keystrokes
CHI '18· User Research Methods (Interviews, Surveys, Observation) +1
- 60%
Interactive Extraction of Examples from Existing Code
CHI '18· Open-Source Collaboration & Code Review +1
Based on Jaccard similarity of research subtopics & professions (≥60%)