Thinking in blocks: Implications of using abstract syntax trees as the underlying program model

Daniel Wendel, Paul Medlock-Walton · 2015

This paper examines the implications of using Abstract Syntax Trees (ASTs) as the underlying model for program editors and source control. For editors, working at the level of the AST enables error prevention, efficient auto-completion, and seamless use of multiple representations (e.g. blocks-to-text-to-blocks). An AST-based system also lends itself to both real-time and asynchronous collaborative editing, through intention-preserving algorithms much simpler than Operational Transformations. AST-based asynchronous collaborative editing makes several improvements to source control compared to Git, notably: reducing conflicts even in same-position edits, and eliminating diffs (and therefore conflicts) due to changes in formatting, spacing, or method ordering. Even text-based languages can reap these benefits, simply by changing the underlying program representation from text to AST.

Read the paper · More papers on PaperTik