The Crystal Programming Language includes a feature called Macros. As described by the Crystal Documentation “Macros are methods that receive AST nodes at compile-time and produce code that is pasted into a program.”, to simplify this means you can write code that writes more code. This post is a deep-dive into how to write macros and why they’re useful.
I did this writeup a few days ago on using Crystal macros, they’re overlooked by people new to the language but they are quite useful. Would appreciate any feedback or corrections the community has on this
https://nsuchy.me/2019/05/25/crystal-lang-what-are-macros-and-how-are-they-useful/