Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


dave@dthompson@toot.cat (2026-07-17 05:05:51)
making a structural scheme editor has made me realize three things that need to be more modular in guile: read, pretty-print, and expand.

I want a reader that can preserve comments and other metadata (like was that number written in decimal or hex notation?). when you paste text into the editor I have to use a custom parser that attempts to the do the right thing, but the result is a greenspun's tenth rule for lisp parsers.

I wanted a pretty-printer that could traverse custom compound data structures (not just lists and vectors) and perform graphical rendering. I actually implemented this and it's working quite well. I can render regular s-expressions and the editor's AST structure using the same algorithm and render it either as text or sxml. pick a permutation and it works. pretty cool.

finally, I want an expander that I can use on partial programs so my editor can understand the context of an AST node. is it a lexical var? is it a top-level var? is it a syntax transformer? this would allow for radically different visualizations like a box-and-wire diagram a la blender geometry nodes.
Reply