Hacker News new | ask | show | jobs
by F-0X 2395 days ago
Rust macros can do worse things than C macros can. They can execute arbitrary code at compile time.
1 comments

That is only with procedural macros. Normal macros operate just by token substitutions.

Procedural macros are also special in that they are the only macros that can be 'unhygenic': creating new identifiers in the current scope that were not passed as an argument to the macro.

(Although knowing if something is a procedural macro or not is not obvious when using one in code)