Programming Interfaces ¡ Postdoc @ UCSD (with Haijun Xia) ¡ bhempel@ucsd.edu ¡ CV
In the 80's, computers transitioned from text-based to graphical interfaces. The new, graphical interfaces were a great fit for document processing tasks, but computational tasks stayed in the realm of text-based programming. VisiCalc's introduction of spreadsheets brought some computation into the graphic realm, but the power gap between spreadsheets and "real" programming remains to this day.
Can we make everything you see computable? And, can that scale from end-users to professional programmers? The key is to make computation a globally available interaction. You should be able to compute on anything you can see. Click on something to "extract" it (i.e. to generate the line of code to get that item), choose an action on it from a menu (i.e. call a function on the item), and modify the action's parameters with a graphical widget (i.e. to change the function arguments). Rinse and repeat, and you are programming!
I enjoy discussing programming UIs, programming pain points, and the future of programming. If you have any questions or comments or just want to bounce your crazy ideas around, shoot me an email!
Cellery augments the freeform spreadsheet grid with optional block structures. There are four structure types: atoms (single cells), 1D lists, 2D (hierarchical) tables, and blocks (i.e. templates for reuse). Users may add these structures before or after data entry. Structures nest, so there can be e.g. a list of blocks, each with a table and properties (as in the picture at right). The structures enable extra interactivity and allow users to compute on those semantic structures within the formula language. One simple but elegant innovation is "label cells", where a structure's name comes from the text in an ordinary cell in the spreadsheet. Users may refer to the structure by that name in their formulas.
Plottery adds graphical direct manipulation to the popular Matplotlib plotting library within Jupyter notebooks.
New graphical widgets enable users to add to, modify, and tweak their plots.
The graphical interactions are immediately reified in the user's code, so users may freely mix-and-match between GUI, code, and AI interactions.
In a user study, participants seamlessly alternated modalities, with the GUI used for straightforward visual changes, code for quick edits or duplicating code, and the AI for broad support.
Plottery is released and available for use: pip install plottery-ui.
Some computational notebook authors prefer to clean their notebooks continuously (as found by recent work). To support this always-clear workflow, we built Tidynote, a Juptyer implementation that exposes a scratchpad to side that users can move cells into and out of, supporting exploration and archiving without disturbing the narrative in the main notebook. The extra workspace could increase confusion about Python runtime state, so Tidynote enforces top-to-bottom notebook execution so that independent scratchpad explorations do not affect each other or the main notebook. The key value in Tidynote is its practical simplicity: it's an interface I could see myself using.
We observed (n=13) and surveyed (n=99) professional software developers (3+ years of experience) to try to cut through the hype of what is and is not working with AI agents. We find that experienced developers prompt carefully: they do not vibe, but control the agent through clear instructions with lots of context, dovetailed with iterative verification of the agents' work (but not always by reading the code carefully). Surveyed developers report that agents accelerate straightforward, repetitive, and scaffolding tasks, including writing tests, documentation, general refactoring, and simple debugging. But as task complexity increases, agent suitability decreases: they avoid agents for business logic and do not yet find agents fit for completely autonomous operation. Opinions about design and architecture planning are mixed: some developers write plans themselves, while others enjoy developing plans with agents.
Writing commands by reading man pages is a pain. We worked out a mechanism to fully automatically turn man pages into interactive graphical interfaces that allow you to craft commands by exploring and clicking on arguments in a GUI. The key idea was to have the AI produce a grammar for parsing valid invocations of a command. As part of the grammar generation process, the AI annotates which grammar rules correspond to options and arguments.
We developed a DSL for transforming concrete data structures, such as those displayed with print statements in a programming language, into abstract diagrams, such as what you might draw on a whiteboard or illustrate in a textbook.
Our system and DSL, called Chisel, can serve as a foundation for bridging actual data in programs with more humane representations useful for teaching, documentation, communication, and runtime debugging.
A characterization of ASCII diagrams in several large open source code codebases. We found that developers reach for ASCII because it lives naturally not only in the code, but also in the ecosystem of text-oriented code collaboration tooling. The diagrams themselves display diverse concepts with diverse visual forms and are connected to the code, often incorporating code snippets.
Maniposynth, the capstone project of my thesis, is a bimodal environment for functional programming. The key question is how to offer non-linear graphical interactions while still representing the program as ordinary, linear code.
Ph.D. dissertation covering Maniposynth, Sketch-n-Sketch, and Tiny Structure Editors, with Deuce in the appendix.
An early prototype of Maniposynth. ManipML discovered a mismatch between static type systems and live programming tools: parametric polymorphism. Live tools need the concrete type of a value to display it properly, but that type is unavailable at polymorphic code locations. ManipML solved this problem by monomorphization, and Maniposynth by running the code through an interpreter rather than a compiler.
If bimodal programming becomes more widespread, how can users easily specify a GUI for their custom data types? Tiny Structure Editors automatically transforms the output of toString functions into GUIs for manipulating the original object. The key technical idea is to track dependency provenance of substrings.
Sketch-n-Sketch is a direct manipulation GUI for creating programs that output vector graphics, while simultaneously representing the program as always-editable textual code. This is the paper to read if you want to learn about the project. Compared to the prior versions, many of the tools were reworked and improved, in particular, this version supports manipulating intermediate outputs (points, offsets, and lists) and editing within a function. The concept of a "shape group" was simplified to being just an ordinary list in the program.
A more verbose description of Sketch-n-Sketch, but the PhD dissertation above is better if you're looking for details.
Instead of manipulation of output as in the other systems here, Deuce explores a streamlined interaction for quickly selecting multiple AST elements and invoking refactorings relevant to those elements.
The version of Sketch-n-Sketch that also assisted with program construction. This version introduced drawing tools, the "Make Equal" interaction that enforces alignment by inserting a shared variable, and simple abstraction capabilities.
The first version of Sketch-n-Sketch. Via expression provenance and a simple solver, direct manipulations on output change the numeric literals in the program to match.
| Organizing Committee | LIVE 2021, LIVE 2020 |
|---|---|
| Program Committee | LIVE 2026, VL/HCC 2026, LIVE 2025, VL/HCC 2025, PLDI 2025, LIVE 2024, Onward! Papers 2024, Convivial Computing Salon 2020, LIVE 2018 |
| Artifact Evaluation Committee | PLDI 2019, PLDI 2018 |
| Reviewer | CHI 2027, UIST 2026, CHI 2026, UIST 2025, ESE 2025, CHI 2025, UIST 2024, POPL 2024, UIST 2023, TOCHI 2023, PLATEAU 2023, CHI 2023, UIST 2022, UIST 2021, UIST 2020, CHI 2020, UIST 2018 |
For summer/fall 2022, I was a postdoc at CIWRO and the Storm Prediction Center to improve and operationalize my Nadocast severe weather predictor.
In March 2022, I finished my Ph.D. in the PL group at UChicago, advised by Ravi Chugh. Ph.D. research question: Can we augment programming with direct manipulation interactions?
If you have any insight or reaction to any of these, feel free to shoot me an email so we can both be enriched!
The number of core, orthogonal computational concepts (types) that programmers use is fairly small, probably on the order of about 100-1000. Despite this, because UNIX mandated that everything is a list of bytes, none of these concepts have OS-level support. Instead, each application re-invents its version of those concepts, wasting programmer time and preventing users from composing their own workflows. Elevating these core concepts to have OS-level support for visualization and interactive operation could drastically improve the power of computers and the simplicity of software.
man pages was an okay idea for the 1970's. It's 2026. The UI could provide a lot more help. Though wires-based VPLs are not appropriate for general programming, such a VPL might make a good shell replacement.A mostly failed experiment attempting to use RNNs to predict a Haskell type signature given the function name and the three prior type signatures in the file. A BS/MS student built on this workâthis report was placed online so there was something to cite. Though my experiment failed, I'm still optimistic about the motivation. Writing specs is hardâcan we use semantic information in names to suggest specifications which could then be fed to a program synthesizer? Compared to regular code, specifications have the advantage that they are an unordered set of properties. You (the human or computer) can generate them in any order and may add and remove individual items freely (unlike additions and removal of code, which generally necessitates lots of reworking and cleanup). If I were to revisit this project, I'd reformulate the problem to predicting a set of properties rather than whole type signatures. To start, the return type would be a property in the set and the input argument types would each be a a property in the set (effectively, arguments would be treated as a set rather an ordered list). But by treating properties as elements of a set, you're not limited to just predicting types: you might predict properties such as "Is this function is recursive?" or "How long is this function?" or "Does this function preserve the input size?" and all of these other properties, along with the type properties, could form the specification of the function for static checkers or a synthesizer.
One useful bit of the project is a high quality regular expression for splitting variables into words (see identifier_segmentor.py). If you also apply a stemmer afterwards you obtain very useable results like the following:$ pip2 install nltk $ python2 >>> from identifier_segmentor import * >>> print " ".join(segment2("mkNameG_tcIdKey")) mk Name G tc Id Key >>> print " ".join(segment2("unsafeTExpCoerceIdKey")) unsaf -e T Exp Coerc -e Id Key >>> print " ".join(segment2("M.Map")) M -. Map >>> print " ".join(segment2("unsafeShift32R")) unsaf -e Shift 32r >>> print " ".join(segment2("castDoubleToWord64Array")) cast Doubl -e To Word 64 Array >>> print " ".join(segment2("STUArray")) Stu Array >>> print " ".join(segment2("PrimMVar")) Prim M Var >>> print " ".join(segment2("X86.Instr.JumpDest")) X86 -. Instr -. Jump Dest >>> print " ".join(segment2("Typed.TypedDefinition'")) Type -d. Type -d Definit -ion âThe file above with the stemmer is python but the regex alone should segment correctly in any number of languages.Ruby:
$ irb irb(main):004:0> "mkNameG_tcIdKey".scan(/\'|(?:^[^A-Za-z0-9\s\'])?(?:[^a-z\_\s\'\.]+$|[^a-z\_\s\'\.]+[0-9\.]|[^a-z\_\s\'\.]+(?![a-z])|[A-Z][^A-Z0-9\_\s\'\.]+\.?|[^A-Z0-9\_\s\'\.]+\.?)/) => ["mk", "Name", "G", "tc", "Id", "Key"]Javascript:
$ node > "mkNameG_tcIdKey".match(/\'|(?:^[^A-Za-z0-9\s\'])?(?:[^a-z\_\s\'\.]+$|[^a-z\_\s\'\.]+[0-9\.]|[^a-z\_\s\'\.]+(?![a-z])|[A-Z][^A-Z0-9\_\s\'\.]+\.?|[^A-Z0-9\_\s\'\.]+\.?)/g) [ 'mk', 'Name', 'G', 'tc', 'Id', 'Key' ]Just please give me credit if you use my segmentor regex!
The Elm 0.18 exhaustiveness checker has exponential complexity for certain case statements. The following patched versions of elm-make tame this explosion somewhat and reduce Sketch-n-Sketch build times by 5x (or more). More nominal cases might see some slowdown instead of a speedup.
Replace your elm-make executable with one of the following binaries:
Computers can't pray.
Technical progress is not moral progress.
As your loved one dies, would you rather than a robot hold their hand?