> I’m surprised rust went with macros instead of something like comptime - though I assume there’s some trade offs I’m not aware of.
Rust has procedural macros which are Rust libraries built and run compile time that can transform raw tokens into valid Rust code (or more raw tokens for nested macros). Procedural macros can annotate any statement or code block - although some specific ones might still be on nightly only.