Making Hybrid Languages: A Recipe
Leif Andersen, Cameron Moy, Stephen Chang, Matthias Felleisen
TL;DR
This paper addresses the rigidity of traditional linear programming languages by proposing a recipe to create hybrid languages that integrate visual, interactive syntax with text, enabling domain-specific visuals without disrupting existing workflows. The approach hinges on adapting an existing language and IDE, reusing an existing GUI library, and defining a simple, multi-phase interactive-syntax definition (state, render, elaborate) to support both edit-time visualization and run-time semantics. The authors demonstrate the recipe by instantiating Hybrid Clojure-Script with a CodeMirror-based IDE (elIDE), including a Diagram visual extension for Bézier curves, supported by a Stopify sandbox for safe edit-time evaluation. Their evaluation argues that the DOM-based design preserves and enhances typical workflow operations, enables reuse of libraries, and provides practical benefits across multiple case studies (REST protocol diagrams, board-game UI, and meta-extensions). The work offers a concrete path toward maintainable, backwards-compatible hybrid languages that can be extended to other languages and IDEs, with promising implications for developer productivity and domain-specific tooling.
Abstract
The dominant programming languages support only linear text to express ideas. Visual languages offer graphical representations for entire programs, when viewed with special tools. Hybrid languages, with support from existing tools, allow developers to express their ideas with a mix of textual and graphical syntax tailored to an application domain. This mix puts both kinds of syntax on equal footing and, importantly, the enriched language does not disrupt a programmer's typical workflow. This paper presents a recipe for equipping existing textual programming languages as well as accompanying IDEs with a mechanism for creating and using graphical interactive syntax. It also presents the first hybrid language and IDE created using the recipe.
