Rust's Witchcraft
3-Second Blueprint (English)
- Rust macros operate on typed syntax fragments (`ty`, `expr`) rather than raw text, enabling zero-cost codegen and native DSLs.
- Unlike external transpilers like Babel/JSX, Rust macros preserve compiler type checking, hygiene, and exact line diagnostics.
- Procedural macros execute Rust code at compile time—allowing `sqlx::query!` to verify SQL against live database schemas.
RustDeclarative MacrosProcedural MacrosSQLxAST Metaprogramming
3-Sekunden-Fazit (Deutsch)
- Rust-Makros arbeiten auf typisierten Syntaxfragmenten (`ty`, `expr`) statt Rohtext und ermöglichen typsichere DSLs ohne Overhead.
- Anders als externe Transpiler wie Babel/JSX bewahren Rust-Makros Hygiene, Typsystem und zeilengenaue Compiler-Fehlermeldungen.
- Prozedurale Makros führen Code zur Compile-Zeit aus – `sqlx::query!` prüft SQL-Abfragen direkt gegen echte Datenbankschemata.
RustDeklarative MakrosProzedurale MakrosSQLxAST-Metaprogrammierung
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.