I think both Template Haskell and MetaOCaml have some typechecking of macros.
Though I haven’t found macros very useful or exciting. To me the most fun way to program is with simple code, but relying on a lot of implicit understanding. Something like what Kragen describes here:
Also, sometime around 1993, I read Robert Sedgewick’s textbook, “Algorithms in C”, which I borrowed from my father, Greg Sittler. It opened a whole new world to me. The programs in the book are all concise crystals of beauty, showing how a few lines of code can transform a pile of structs of integers and pointers into a binary search tree, or a hash table, or the minimal spanning tree of a set of points. It used only the basics of C, and did not rely on any libraries.
This was a revelation to me; there was beauty and magic in these programs, and it wasn’t because they were calling on powerful libraries hidden, Wizard-of-Oz-style, behind curtains. They were just plain C code, and not very much of it, that “developed a set of operations that were not obviously implicit in the original set,” to borrow Bruce Mills’s phrase.
I think both Template Haskell and MetaOCaml have some typechecking of macros.
Though I haven’t found macros very useful or exciting. To me the most fun way to program is with simple code, but relying on a lot of implicit understanding. Something like what Kragen describes here: