Where is the macro system in the source tree?

Hi,
I want to know where is the source code located for the Racket's macro system?

And what would it take to rewrite it from scratch?

Thanks

1 Like

For the first question, it's https://github.com/racket/racket/tree/master/racket/src/expander/expand

For the second question, take a look at https://www.youtube.com/watch?v=Or_yKiI3Ha4 and https://github.com/mflatt/expander.

4 Likes

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