I’m obsessed with structural editors because it feels intuitively like the right approach to creating software. However I’ve yet to come across an interface that really clicks. Still love it though. Right now I’m building a structured editor for creating UIs, so can attest to how difficult it is to get it right.
I'd really like to get to the point where I have a library of transformations and you can make your own interface. Already the click ui and hot keys ui call the same `insert_function` or `assign_to` functions. Adding a ui with lots of dragging or voice control should be trivial
I’ve actually moved away from GUI controls and towards something resembling a keyboard command language. Similar in spirit to vim motions, but instead of applied to text, it’s applied to an AST.
I think that could be the key to making structured editing feel less “clunky”.
Couldn't you implement this as a plugin in your text editor?
I think this could work reasonably well in Vim. You could have a shortcut in normal mode 'av' (add variable) which would let you create a new variable and possibly set its type and the same every other construct in the language (structs, functions...).
The AI could probably even give you better suggestions in this workflow because it would have a better understanding of what you are trying to do.
If you really think about it, a plugin like this would be a more 'strict' snippets engine. After the LLM revolution we kinda forgot about the idea of using snippets to insert text into our files. But maybe its time to bring this idea back?
Possibly! Though I think one of the purported strengths of a structured editor is that it restricts the ability to create invalid syntax. What you're editing really isn't _text_, per se. But you could definitely get halfway there with what you describe. That would be pretty interesting.
It’s a super interesting problem space.