Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hyphenation of “Rust-version–aware” #359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SabrinaJewson
Copy link

In standard English grammar, the way to hyphenate “Rust version” and “aware” is by using an en dash (https://en.wikipedia.org/wiki/Dash#Attributive_compounds). Inserting a hyphen between “Rust” and “version” isn’t right since the phrase is not usually hyphenated.

An alternative is to write rust-version-aware, i.e. specifically referring to the Cargo key. Not sure if that was the intent here.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting some action (such as code changes) from the PR author label Feb 17, 2025
@ehuss
Copy link
Contributor

ehuss commented Feb 18, 2025

@epage Can you review this? I assume the intent was to stay consistent with the key name.

@epage
Copy link
Contributor

epage commented Feb 18, 2025

From my understanding this is changing Cargo: Rust-version aware resolver (hyphen) to Cargo: Rust version–aware resolver (en-dash) where

  • hyphen is intended for joining compound words but is falling out of fashion for space (e.g. fig leaf) or merging the words (e.g. toolbar) (source)
  • endash is intended for a compound of a compound (source)

For myself, as a native english speaker, I did not know any of this and I feel this adherence to english rules can get in the way of communication. I suspect it will be even worse for english-as-a-second-langage. The visual distinction between a hyphen, an en-dash, an em-dash, etc is very minor and I expect most people will not notice, especially when not next to each other. I also wonder how many people are like me and are unaware of these rules. In that context, seeing Rust version–aware resolver reads as rust . version-aware . resolver vs rust-version . aware . resolver or rust . version . aware . resolver. rust . version-aware . resolver changes the meaning of the phrase.

We could find an alternative way of phrasing this to avoid this conflict between correctness and clarity but I worry that will lead to a verbosity that will also get in the way.

@epage
Copy link
Contributor

epage commented Feb 18, 2025

Hmm, looking further on wikipedia,

In English, an en dash, –, sometimes replaces the hyphen in hyphenated compounds if either of its constituent parts is already hyphenated or contains a space (for example, San Francisco–area residents, hormone receptor–positive cells, cell cycle–related factors, and public-school–private-school rivalries).[29] A commonly used alternative style is the hyphenated string (hormone-receptor-positive cells, cell-cycle-related factors). (For other aspects of en dash–versus–hyphen use, see Dash § En dash.)

It makes it sound like Rust-version–aware and Rust-version-aware can also be accepted.

@SabrinaJewson
Copy link
Author

I also think “Rust-version–aware resolver” reads well, so I updated it to that.

@SabrinaJewson SabrinaJewson changed the title Fix hyphenation of “Rust version–aware” Fix hyphenation of “Rust-version–aware” Feb 18, 2025
@salewski
Copy link
Contributor

salewski commented Feb 19, 2025

We seem to be discussing two different things here:

  1. What might be the proper way to hyphenate some combination of words in the sequence "rust version aware resolver"
  2. How to best represent the hyphenation with "characters" (e.g., ASCII/Unicode HYPHEN-MINUS (U+002D) vs. Unicode EN DASH (U+2013) vs. something else)

Regarding (1): we are describing a "dependency resolver" that is aware of the Rust versions (as opposed to saying the resolver is aware of "versions", abstractly). Therefore the three words "rust version aware" are a single phrasal adjective. Ordinarily, all words in a single phrasal adjective would be hyphenated, so we would have "rust-version-aware resolver".

However, there is a special case for proper nouns, in this case "Rust". Garner1 states (under PHRASAL ADJECTIVES (F), p. 830): 'When a name is used attributatively as a phrasal adjective, it ordinarily remains unhyphenated. E.g.: "The Terry Maher strategy..."'.

As the currently published edition is written, "Rust" is capitalized, meaning that the author was referring to Rust the programming language, which has assigned versions, rather than rust-version, the key name that may appear in a Cargo.toml file. If we are to keep the current phrasing, then the proper noun "Rust" should not be connected by a hyphen to the rest of the words in the phrasal adjective, which should themselves be connected. Thus we would have "Rust version-aware resolver".

Alternatively, the clause (currently written as) "...which enables a Rust-version aware dependency resolver." could simply be changed to "...which enables a dependency resolver that is aware of Rust versions." That would keep "Rust" as a proper noun, but would avoid the phrasal adjective.

There is also a case that could be made for removing the proper noun "Rust". Since the key name in a Cargo.toml file is rust-version, and that provides the value against which the Rust version comparisons will be made (somebody please correct me if I've got that wrong), it would be reasonable to describe the dependency resolver as being aware of that value. With Markdown, that would be: "rust-version-aware resolver".

Regarding (2): I don't think Markdown is the proper place to get too deeply into typography, as it is intended to be "used like email" and different renderers will do different things. I would suggest just sticking with ASCII/Unicode HYPHEN-MINUS (U+002D), which is what you usually get when you type the button next to to zero key on the top row of a typical US keyboard. It is also the expected ASCII character in hyphenated fields in Cargo.toml (e.g.: rust-version). If we are getting fancier than that, then Markdown is probably not the right tool -- LaTeX would be better for producing pristine typography.

Summary:
My recommendations would be:

  1. Go with "rust-version-aware resolver"
  2. Stick with ASCII/Unicode HYPHEN-MINUS (U+002D)

Thoughts?

Footnotes

  1. Garner's Modern English Usage: The Authority on Grammar, Usage, and Style, 5th ed. by Bryan A. Garner, Oxford University Press, 2022

@epage
Copy link
Contributor

epage commented Feb 19, 2025

Note that the Rust version resolver respects the rust-version field of your dependency relative to either your rust-version field or your Rust toolchain version. I expect people are considering the last half of this when they see it so being generic about the source of the Rust version would be more correct. For example, people also refer to this as "MSRV aware resolver", meaning its referring to what your project is doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting some action (such as code changes) from the PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants