experimental macro support

Looks similar to the code we've seen above. Can we deduplicate?