@dthompson FWIW I wrote a simple macro-expander for Scheme in about 500 lines (with explanations/derivation) in my master thesis:
https://github.com/panicz/master-thesis/blob/master/chapters/C.tex
It operates on s-expressions rather than syntax objects, but it supports a pattern language akin to 'macro-by-example' with some extensions, and it also tracks the derivation, so that the expanded code can be 'impanded' back (this feature isn't implemented in the above code, but I had it running on my laptop, and in my bitbucket repo that atlassian decided to kill)