Where is the macro system in the source tree?

Depending on what exactly you mean by "rewrite it", you might be interested in the discussion in this thread on how different pieces of Racket are put together:

In particular:

I heartily second the recommendation for Matthew's talk in that video, “Let’s Build a Hygenic Macro Expander”.

2 Likes