A language that makes it easy to represent how to process a potentially complex but semi ad-hoc structure in a coherent way is interesting. A language that's added a special case for when the processing you want to do happens to be printing is much less so. Derive is a poor substitute for a proper record system.
Re:Rust vs. C++ Formatting
by forrestthewoods on Tuesday January 17, 2023 @01:33AM
(#34409715)
Maybe. But a poor substitute is radically superior alternative to literally nothing.
I disagree in the strongest, most emphatic way possible.
As a user of programming languages the difference between printing in C and printing in Rust is night and day. Whether that is achieved with a powerful macro system or with the core language does not matter to me in the slightest. It carries zero weight.
Writing code that prints variables in C is painful and bad. Writing code that prints variables in Rust is easy and good. If you'd like to say that "easy and good" is the same as "painful and bad" then I disagree.
When std::format ships the gap between C++ and Rust will shrink dramatically. However Rust will still have an advantage with derive macros. C++'s lack of reflection continues to be a major pain point. Maybe in C++29.
I don't think you can fully separate "language" from "macros". If something can be implemented easily in a macro then there is less reason to bake it into a new feature in the language. I don't think it's a good idea to add language features solely so you can say it's a language feature and not a macro feature. YMMV.