I heard from Paul Biggar (who made Dark lang) that of the couple thousand people who have used Dark, a common experience is that creating text in Dark's structural editor feels nice, but editing doesn't feel nice
an example is when you have fn ["foo", "bar"] and you want to combine the two string literals by putting the right after the " in "bar and pressing backspace 4 times
in a traditional text editor, at some point in there you have a syntactically invalid state like fn ["foo", bar"]
or copy/pasting one part of the AST into another part, while highlighting something that doesn't happen to be right on an expression boundary, or even on a token boundary
it seems like tylr has an interesting solution to this!
Other structure editors restrict you to simple operations on the AST. For example, if you have the expression
2 + 3 * 4in Scratch or MPS, you can't select things like* 4or even2 + 3—never mind directly manipulate them—because they don't correspond to complete subtrees in the AST. Uniquely among structure editors, tylr lets you select and manipulate near-arbitrary range selections, including those corresponding to sub- and cross-tree portions of the AST.
it also seems like doing this from an AST perspective in conjunction with typed holes from a type-checking perspective can mean that we can still support type introspection and related editor plugin things, even if parts of the tree are temporarily malformed
It sounds like that in some sense, you'd like both editing over the AST and over the actual text buffer
Didn't we already talk about how we want to be able to turn any node into a text buffer node. So if you ever directly edit the the text, it will convert the smallest section possible into a buffer node instead of a true AST node? If we can parse all or part of the buffer node, that will be converted into an AST node.
yeah, what's interesting is seeing a project that actually addresses the UX problem in practice!!
We've talked about something similar to the buffer node before, but your idea may be even better @Brendan Hansknecht :)
Cool! And definitely important to consider!
In Elixir there recently were new functions added to parse text into incomplete ASTs, also for better editor/language server /other tooling integration, for exactly the same reason
Last updated: Jun 16 2026 at 16:19 UTC