With a little care and experimenting with re-builder, you can use query-replace-regexp to do syntax transformations on old code. Wonderful.
miniblog.
Related Posts
LLMs are great at style transfer, and this works surprisingly well for syntactic transformations too.
I rewrote a small website's EJS templates to 1500 LOC of TSX with a oneshot in Claude. It took ~12 minutes, but it just worked.
(TSX seems nicer than EJS for static analysis.)
I've realised that there are text transformations I can do in markdown that often aren't possible in rich text.
E.g. from
[foo bar](https://example.com/)
to
foo [bar](https://example.com/)
Rich text usually forces me to remove the old link then highlight the new range.
Really cute Clojure project that builds a full parse tree (i.e including whitespace), allows code to transform the _abstract_ syntax tree, then splices the changed sexp whilst preserving source comments! https://vimeo.com/45695419
Enables code transformations that look like macros.