14

There are currently:

We have considered removing because there aren't many questions, but the tag does allow us to have some extra information and links in the tag wiki. Rust macros recently became more powerful, so this is a big topic, which is likely to attract more questions in the future.

There are two main kinds of macro in Rust; procedural and "by-example". The latter is less powerful, but has its own unique syntax, which can be something of a learning curve for newcomers. The former doesn't have special syntax, but involves traversing an AST, which also can be a difficult concept for newcomers to the topic.

Either way, a macro in Rust is very different to a macro in C/C++ or any of the other languages that dominate the tag (including plenty of mis-tagged Excel & VBA questions).

A suggestion from the Rust chat room is retire and to re-tag all macro-related questions with two new tags: and , which will help to group questions which are likely to have similar root problems or are answerable by people with more specific expertise.

5
  • 1
    with two new tags — with one or both of two new tags, right?
    – Shepmaster
    Jan 8, 2019 at 15:22
  • 2
    Would we also remove macros at the same time?
    – Shepmaster
    Jan 8, 2019 at 15:22
  • @Shepmaster I think we would remove macros at the same time.
    – Peter Hall
    Jan 8, 2019 at 15:39
  • @Shepmaster That's a good point. There might be questions where the answer is to use the other macro type, or where both types are relevant.
    – Peter Hall
    Jan 8, 2019 at 15:41
  • The macros tag is wildly overused over at excel & vba - it's a constant clean up process there.
    – dwirony
    Jan 8, 2019 at 17:37

1 Answer 1

13

As macros in Rust have a specific syntax, like most other languages, I think makes sense.

Adding is a good idea but I think we should keep rust in front of stuff related to Rust, so is better for me.

Another thing is that you proposed the word macro without an s. I think we should stick to one style.

I don't think should be used to refer to common macros. As you said, this is used in the reference but this documentation is not very used. I also don't know if they named it this way long ago and changed their mind — in the most recent book they call them declarative macros:

the most widely used form of macros in Rust are declarative macros. These are also sometimes referred to as “macros by example”, “macro_rules! macros”, or just plain “macros”.

Declarative macro is in my opinion a better name that "macro-by-example".

I think we should either keep or change it to or (a long tag is not a big problem with auto-completion, but this feature is not always present)


To sum up my will:

15
  • "by-example" is the declarative, pattern-matching style macro. i.e. the other kind of macro,
    – Peter Hall
    Jan 8, 2019 at 15:42
  • 1
    The terminology is used for example here: doc.rust-lang.org/reference/macros-by-example.html
    – Peter Hall
    Jan 8, 2019 at 15:47
  • I think rust-macros makes sense — would you recommend removing macros as well?
    – Shepmaster
    Jan 8, 2019 at 20:12
  • @Shepmaster I think this tag allow to regroup the macro concept in one tag. We can't edit tag info of macros to include all possible languages macros definition, but we could edit it explain the situation and add link to specific tag for every language like their did for excel-vba. We can't clean every question of SO, but we could take care of rust one and maybe other language will follow. Also, I think that doesn't hurt a question to have both rust-proc-macro and macros. Some people like to answer every macro question in any language.
    – Stargateur
    Jan 8, 2019 at 20:31
  • @Shepmaster for rust-macros, I think if we add both rust-proc-macro and rust-decl-macro we should remove it. Because that would be too much tag to keep. macros will just contain two link for rust case, where we have two type of macros, not a big deal.
    – Stargateur
    Jan 8, 2019 at 20:37
  • 2
    Is this level of granularity really useful? If people are already using the more general macros instead of rust-macros I doubt they'd jump to two more specific tags which are even less discoverable in the tag editor. It seems like a bunch of ongoing retagging maintenance for very little gain. Do you expect many experts would follow a specific type of rust macro tag while ignoring the other? Jan 8, 2019 at 21:54
  • @PaulCrovella I agree, I also doubt this would be very useful. I just thought it could be "clean" this way, we could remove it from questions and keep it on SO as a hub tag, "if you want use macros tag in your question don't use this one but prefer one of the more specific tag listed here". Is tag get deleted if they have too few questions ?
    – Stargateur
    Jan 8, 2019 at 22:00
  • I think a tag gets deleted if it has no questions, but even if it didn't it wouldn't matter much - people out there asking don't read tag wiki info box usage guidance in the first place. If y'all'll make good use of the wiki space I can see favoring rust-macros over macros, but there's plenty room there for both kinds of rust macros on the page. I don't see the practical value in them being divvied up, it seems more like just a taxonomic exercise. Jan 8, 2019 at 22:19
  • @PaulCrovella "taxonomic exercise", exactly the purpose of tag ? I totally disagree, this is really useful to have both tag for rust.
    – Stargateur
    Jan 8, 2019 at 22:23
  • Taxonomy isn't itself a purpose, it's a means to an end. I don't see what that end is here. What benefit is adding these tags bringing? Jan 8, 2019 at 22:37
  • @PaulCrovella Simply sort questions, that would allow to search question and answer faster, especially because these questions will share the same keyword, but will be totally different. For example, if you want create a macro, declarative and procedural way are totally different but keyword would be "create" "macro". That for sure need two tags.
    – Stargateur
    Jan 8, 2019 at 23:08
  • So this is for the benefit of people who are searching for "rust decl macro"? Jan 8, 2019 at 23:14
  • @PaulCrovella Part of the reason is because prodedural macros have recently become more powerful in stable rust. There aren't many questions about them up until now because they haven't been used much, but there are likely to be a lot more coming.
    – Peter Hall
    Jan 13, 2019 at 13:19
  • TBH I'm leaning towards a single rust-macros tag. It just seems like less maintenance.
    – Peter Hall
    Jan 13, 2019 at 13:20
  • @PeterHall I'm volunteer to take care of the work. I don't think it would take me a lot of time, of course after we will handle new question with proper tag but if you are afraid of the initial work I will do it.
    – Stargateur
    Jan 14, 2019 at 2:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .