Just a quick question. I had my fair share of writing proc macros these last months for many libs and services.
Will there be a day we can write them in pure rust, without relying on syn and quote ? And maybe without creating a dedicated derived crate?
Same question for macro_rules (I came across the crabtime crate but didn't try).
No issues if its not the case. It's just to know if simplification is on its way or not (yet).
What do you mean? syn and quote are "pure rust" crates, and you can avoid them if you want to (though of course you'll have to reimplement the functionality you're using from them)
Yes you are right, I meant, directly using the language without external crates.
not having to use quote! { #vis #name: <#value_type, or #(#builder_fields_preparation_child)* (instead of a rust loop).
See, this is what I mean, partially writing a foreign language.
As far as I see things, I would not make the equivalent of syn and quote crates, because it's way too much.
What I meant is the feeling of writing a different language, needing macro expansions all along to make sure everything is in order.
It quickly adds up with the complexity of one's code.
You can build a TokenStream (which the built-in at the base of procedural macros) using a for loop if that's what you want, but it will be a lot less ergonomic than using quote
You don't want to write macros then, you want other higher level metaprogramming features.