I've been noodling on structural editing for a while now. I'm fully bought into Lisps myself, but most of my friends and coworkers are skeptical, and I think a lot of their skepticism has to do (as usual) with all the parens. One of the points I make frequently is that with Lisp code being written as a nested data structure, the textual representation is just one of many possible representations. But it can be hard to get across what that means without concrete examples.
A few years back, I ran across Fructure for Racket. To this day, it's still the structural editor with the most appealing visual display to me. But Fructure itself has a few drawbacks for my purposes:
In addition to these, I've been wanting a way to make Guix configuration as easy and painless as possible for new users. Having a sort of "command palette" available seems like it might be a good way to accomplish this.
So recently, I did a quick initial sketch of what such a system might look like:
I have a few initial use cases in mind:
operating-system
or file-system
) are written as Guix-specific record types, so there may be some metadata about expected values in each embedded in them that you can tap into somehow.Obviously given the fact that there are two styles of very different interfaces here, this has to involve some sort of runtime checking. And we probably can't entirely infer which to use based solely on the source code, so there's probably some per-project editor configuration needed for this to work. But... I think this might be doable.
I need to look into this some more, but a good starting point might be the nREPL protocol. It seems pretty extensible, and already has support for symbol lookups and such. But need to look into this all some more!