Is there a library for code generation that is easier than procedural macros?

I am looking for something that can generate code like proc macro but is user friendly. I've tried proc macro and found them difficult. For example, there is library that can generate code using declarative macros that are easier to write than pure declarative macro syntax here : crabtime - Rust. But unfortunately, it often lack support for derive and attribute macros. I am aware of proc macro2, syn, and quote and have tried them, but the development process is very complex and hard. Is there a library for generating derive and attribute macros, or a code generation tool that yields the same results but is easier to use?

1 Like

You can use macro_rules_attribute to approximate derive and attribute macros with macro_rules. (There is also a language feature in development that will allow macro_rules! to declare derive and attribute macros directly.)

1 Like

Thank you very much!