Implement textual substitution, syntax-aware macros, and hygienic expansion. Design compile-time APIs that prevent accidental variable capture and preserve useful source locations.