4 ms·
The crucial difference between TMPL in C++ and Rust macros is that TMPL is unavoidable because it provides so many features of the language, whereas Rust macros
by kibwen 9y ago
The crucial difference between TMPL in C++ and Rust macros is that TMPL is unavoidable because it provides so many features of the language, whereas Rust macros are only good for DSLs. For example, parametric polymorphism in C++ must be done via templates, but Rust just has generics, full-stop, and debugging those is no problem. I'm in agreement with the grandparent comment that praises Rust macros for having gross syntax; whether or not it was intentional, it discourages people from using them except in extreme circumstances, which in my mind is a feature. :)
- deleted 9y ago[deleted]