Structured Editing for All: Deriving Usable Structured Editors From Grammars
Structured editing can show benefits in learnability, tool building, and editing efficiency in programming.
However, creating a usable structured editor is laborious and demanding, typically requiring tool builders to manually create or adjust editing interactions.
We present Sandblocks, a system that allows users to automatically generate structured editors for every language with a formal grammar available.
Our system's input reconciliation process acts on arbitrary syntax trees to provides consistent interactions across our generated editors.
Our editors' editing experience is designed to be familiar to users from textual editing but, compared to previous work, requires no manual annotation in the grammars.
Very interesting. I actually contemplated on building support for importing ANTLR grammars into my structure editor generator, but ultimately decided against it at this point. Found the paper and couple additional videos from here: dl.acm.org/doi/fullHtml/10.1145/3544548.3580785
Have to read the paper later. Couldn't find any references for code generation for now, so I wonder if this is just a prototype that generates the editor which is able to create and modify internal AST, but is not able to read or write textual code of the said language. Integrating with textual codebases would be an obvious requirement for any real world use and something I investigated quite a bit. Reading is of course easy because you can use an existing parser for the language, but unfortunately 'unparser generators' aren't really a thing so you'll have to implement one. It'll be an extra hurdle if you want your structure editor to only make minimal changes to the textual code and not randomly change formatting etc, so that you wouldn't render git diffs useless.
Read most of the paper. Good read. The Introduction and Related Work sections should be of interest to anyone looking for an introduction to the field of structure editors, the results of their user study should be of interest to anyone working on a structure editor (usability). Rest of it is implementation details of their approach which is quite parsing heavy. In my approach literally the only parsing is .NET double.Parse() 😄
I wonder if it's too harsh to say that this is not a structured editor, it's a text editor that also visualizes structure. It feels to me like one of the advantages of a structured editor is that you can't make syntactically incorrect statements, in the same way that a text editor doesn't allow you to insert non-text data.