Macros are a powerful part of a Rust programmer's toolkit, and macros by example are a relatively simple way to access this power. However, to beginners in the language, they're just scary black magic; while println! and vec! are frequently used, they're not something you'd write on your own. At least, that's how I felt when I was starting in the language.
The Rust track needs an exercise which is best solved by using this tool, as a way of introducing people to the concept. To some extent, we have exercises which are implicitly similar if macros are available. For example, the decimal example is implemented in terms of macros. However, there's nothing currently which explicitly suggests the use of macros in a case where they'd make sense.
The elephant in the room WRT a macro exercise is that there is no way to guarantee that the student has actually used macros in their solution; anything which can be generated by macro can be hand-written by a student with a sufficiently high threshold for tedium.
My intent is to use this issue as a space to bat back and forth some proposals for macro exercises, and collaboratively come to a design which makes sense.
Macros are a powerful part of a Rust programmer's toolkit, and macros by example are a relatively simple way to access this power. However, to beginners in the language, they're just scary black magic; while
println!andvec!are frequently used, they're not something you'd write on your own. At least, that's how I felt when I was starting in the language.The Rust track needs an exercise which is best solved by using this tool, as a way of introducing people to the concept. To some extent, we have exercises which are implicitly similar if macros are available. For example, the decimal example is implemented in terms of macros. However, there's nothing currently which explicitly suggests the use of macros in a case where they'd make sense.
The elephant in the room WRT a macro exercise is that there is no way to guarantee that the student has actually used macros in their solution; anything which can be generated by macro can be hand-written by a student with a sufficiently high threshold for tedium.
My intent is to use this issue as a space to bat back and forth some proposals for macro exercises, and collaboratively come to a design which makes sense.