Rust's proc macros are terrific. I've written my fair share of streaming AST transforms for JS (browserify, sheetify, bankai), and the combination of syn/quote makes building similar things for Rust an absolute pleasure!
-
-
Replying to @yoshuawuyts
Do you have recommendations for “how to learn macros”, because they still feel a lot like dark magic to me
1 reply 0 retweets 2 likes -
Replying to @Andysomniac
I think the best way to learn is by doing -- it helps *a lot* that I could use my existing knowledge from JS and apply it to Rust. In essence a proc macro is: fn (token_stream) -> token_stream In between you select the right token from the AST, and replace it with new code!
1 reply 0 retweets 2 likes -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.