Deuce: a Lightweight User Interface for Structured Editing
Deuce: A Lightweight User Interface for Structured Editing Brian Hempel, Justin Lubin, Grace Lu, and Ravi Chugh University of Chicago {brianhempel,justinlubin,gracelu,rchugh}@uchicago.edu ABSTRACT tasks—perhaps even the vast majority [Ko et al. 2005]—fall within We present a structure-aware code editor, called Deuce, that is specific patterns that could be performed more easily and safely equipped with direct manipulation capabilities for invoking auto- by automated tools. Broadly speaking, two lines of work have, mated program transformations. Compared to traditional refactor- respectively, sought to address these limitations. ing environments, Deuce employs a direct manipulation interface Structured Editing. Structured editors—such as the Cornell Program that is tightly integrated within a text-based editing workflow. In Synthesizer [Teitelbaum and Reps 1981], Scratch [Maloney et al. particular, Deuce draws (i) clickable widgets atop the source code 2010; Resnick et al. 2009], and TouchDevelop [Tillmann et al. 2012]— that allow the user to structurally select the unstructured text for reduce the amount of unstructured text used to represent programs, subexpressions and other relevant features, and (ii) a lightweight, relying on blocks and other visual elements to demarcate structural interactive menu of potential transformations based on the cur- components of a program (e.g. a conditional with two branches, and rent selections. We implement and evaluate our design with mostly a function with an argument and a body). Operations that create and standard transformations in the context of a small functional pro- manipulate structural components avoid classes of errors that may gramming language. A controlled user study with 21 participants otherwise arise in plain text, and text-editing is limited to within demonstrates that structural selection is preferred to a more tradi- well-formed structures.
[Show full text]