
I Got Tired of Rewriting Macro Boilerplate — So I Built a Template Engine for Proc Macros
I've been writing proc macros for a while now. Derive macros for internal tools, attribute macros for instrumentation. And every time, the same two problems: quote! doesn't compose (you end up passing TokenStream fragments through five layers of helper functions and writing hundreds of let statements), and debugging generated code means cargo expand and then squinting at unformatted token output hoping something jumps out. Because of this I ended up writing the same helper methods, composite AST parsing and tokenizing types, extractors etc. I would have to copy these from project to project as needed, and eventually just decided to publish a crate so I never have to do it again. So I built zyn — a proc macro framework with a template language, composable components, and compile-time diagnostics. 🎯 Goals Template syntax that supports expressions, looping, composition of reusable custom elements, and editor syntax highlighting + type safety. Automated attribute arguments parsing. Diagnos
Continue reading on Dev.to
Opens in a new tab



