Pre-RFC: Unify dashes and underscores on crates.io

I think we can all agree that the current situation is terrible.

This RFC would be great because it allows Cargo.toml files to move to using underscores (the clear choice for the preferred form) even before/without crates renaming themselves to use underscores – thus preventing the "chicken or egg" problem between renaming crates and renaming dependency entries.

I think the ideal way forward would be to not only implement this RFC, but also (either together or separately),

  • State in the API Guidelines that underscores are the preferred form and hyphens are only allowed (as an interchangeable symbol) for backwards compatibility,
  • Allow renaming crates from hyphen to underscore on crates.io, and,
  • Make a simple script (perhaps cargo fix --hyphenated-crate-names?) to convert both the current crate name and the current crate's dependency entries to use the new preferred format
3 Likes