Macros are a metaprogramming tool used to transform input sequences into different output sequences based on rules defined in the macro. In programs, they allow developers to create domain specific languages, reduce code duplication, and transform expressions at compile time.1
[1] Macro (computer science), Wikipedia. (2019). https://en.wikipedia.org/w/index.php?title=Macro_(computer_science)&oldid=913944080 (accessed March 10, 2020).