Hello,
Thank you for recommending your project!
I wanted to let you a general feedback on my macrokata experience.
Feedback
Overall, it's a really good step-by-step solution and easy to use that you provide.
It greatly helped me in completing the exercism macro exercise.
The book is a really good idea and explains a lot of things.
I didn't have any trouble understanding the vocabulary but that's because I studied compilation so I know how token trees and parsing work. Your token definition is really effective. I don't think people would understand what an AST is in 10.
, or you can provide a hyperlink to an article or a definition online.
Speaking about difficulty, I noticed a significant increase on 8.
and more. A few more examples or advice could help on the separator placement or the expanded code result. I think that before 8.
it is accessible to any rust developer. But you should put a warning in the main README explaining that these exercises are not recommended to beginners in programming.
test command
Can we just type the chapter number ? I'm lazy as any developer so when I saw that I needed to type the entire name of the exercise (am on windows), I was like "why do the titles have long words...", because you do have numbers as your chapters.
And if you fail to find the exercise, it continues with the next sentences and congratulations 🎉 because your stdouts are both empty . You should check the slices length.
How to read the instructions
You say in the main README that we should read the README associated but the code inside says to look at it in the book.
You should add a line just after, saying that you can find the associated chapter in the book with the hyperllink.
Exercise 4
The Macros and the Precedence of Operators paragraph is very short, but maybe too short. You could add a sentence saying:
"... expands to 3 * 4 + 2
, so you compute 3 * 4
first, the answer will be 14, not 18 ..."
Exercise 5
I was kinda confused about the order of identifiers used in the main code, was it done on purpose ?
On the first use of the macro, you start by defining row
then col
but inside you use col
on x and row
on y.
But on the second use of the macro, you define first x
then y
and you use x
to x and y
to y.
I always define in my code the horizontal axis (first dimension) then the vertical (second dimension). I made a mistake on the macro code nesting of the macro. Would it be better to reverse row and col to match the second usage?
Moreover, I failed to understand in the book that the block
fragment specifier DOES include the curly braces, so I didn't have to type them in my macro because you say "(anything inside curly braces)".
Exercise 8
I had trouble with the ;
placement in the substitution macro part.
I didn't know we could just not put a separator when joining the repetitions back together so I spend a long time moving the character all around.
Can the graph be empty? because the matcher could change a lot then and the final ;
be a pain in the 🍑.
Exercise 9
I think the exercise main misses a -
minus sign before creating the enum:
|
NumberType::NegativeNumber($negative) |
Because the goal of the exercise is only to reorder and remove ambiguity.
Exercise 10
I thought the goal was to use tt
but the solution uses ident
, is it important?
Exercise 11
The double arrow and underscore are quite complicated to manipulate, but finding the solution is very rewarding.
Exercise 12
At first I didn't understand we could use the $crate
metavariable to use the structs. the "item or macro" words in the extract is quite generic and does not tell everything (is a macro an item too?). When I saw the example, I thought it was only macros.
Conclusion
I think like I know enough to make use of them, I may not be an expert in rust macros, but with what I learned I can do pretty extensive things. Thanks!