Macro Stepper for DrScheme
Wednesday, November 22, 2006
Eli Barzilay recently announced the availability of a new version of DrScheme. He lists some of the more important features of the release in his announcement; however, the one that interested me most was the Macro Stepper:
"The macro stepper is a new DrScheme tool for debugging macros. It shows macro expansion as a sequence of rewriting steps, where a step is either a single macro transformation or an operation performed by a primitive syntactic form. The graphical display lets the programmer investigate binding and source properties of the syntax involved in expansion."Newcomers to Lisp often get hung up on the fact that debugging Lisp code is a bit different from debugging code in other languages (see some of my previous posts on debugging topics). DrScheme already has a really good code stepper and debugger. The Macro Stepper nicely complements the existing tools by letting one see (step by step) the transformation that occurs as a macro is being expanded. This can be useful when either debugging a macro or when learning Scheme macros.
When you are debugging a macro, you rarely want to have all macros expanded. Therefore, the DrScheme Macro Stepper provides options to allow you to specify which macros will get expanded. However, by specifying that you want all macros to be expanded, you can learn a lot about mzscheme's syntactic forms and how macro expansion in PLT Scheme really works. So, in addition to being a tool for debugging a specific macro, the Macro Stepper can also double as a pedagogical tool.

There is a good manual and tutorial for the Macro Stepper; however, the tool is so easy to use, I doubt many people will use the documentation much. It is worthwhile reading both documents though.
So, a very nice addition to DrScheme! The PLT team continues to innovate in the area of programming languages and IDE's and, once again, demonstrate why I think they have the best open source lisp implementation!

