Re:Writing Complex Macros in Rust: Reverse Polish Notation
by kibwen on Thursday February 01, 2018 @01:11PM
(#16284147)
I tend to agree with the argument that Rust macros are deliberately ugly so that people will only reach for them as a last resort (learning the hard-won lesson from Lisp, as it were), but there's no way that Rust macros are any more confusing than the C preprocessor or C++ templates. Have you ever tried to write a C macro that actually expands to what you want it to, in all possible contexts? And the less said about the horrors of C++ templates, the better. No, the fact that Rust macros have severe (deliberate) limitations is what makes them tractable; there's no shenangians comparable to `#define true false`.
[ Parent
| on HN ]
Re:Writing Complex Macros in Rust: Reverse Polish Notation
by lucozade on Thursday February 01, 2018 @01:32PM
(#16284387)
Th Rust macro system is difficult to use. So it doesn't get used a lot. But when it does it tends to be used well.
The C preprocessor and C++ templates are not difficult to use. But they're both difficult to use well. So they get used. A lot. Badly.