4 ms·
I have a question about that actually, macros in C/C++ are disgusting, why isn't Rust trying to improve it? It's better obviously but it is still not a nice thi
by baby 8y ago
I have a question about that actually, macros in C/C++ are disgusting, why isn't Rust trying to improve it? It's better obviously but it is still not a nice thing to parse.
- steveklabnik 8y agoRust macros are almost nothing like C or C++ macros; they operate on an AST, not on the literal text.
- baby 8y agoI'm talking of the syntax. Why can't I write a macro in more rust-like form for example instead of a very different language
- steveklabnik 8y agoWell, patterns are a very different language than rust; rust has no way to express “one or more of this thing” for example. I wasn’t involved when the syntax was chosen, and that was well before our RFC process, so I don’t have any real, deep explanation for you, sorry!
- mamcx 8y agoIn fact thinking about the same, and because I'm building a toy language, a macro system could look like: https://elixir-lang.org/getting-started/meta/macros.html https://elixir-lang.org/getting-started/meta/macros.html
- deleted 8y ago[deleted]