-
Notifications
You must be signed in to change notification settings - Fork 183
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
Use _
in crate names
#304
Comments
That's one of the Great Unresolved Debates in Rust:
This is exactly the kind of thing I look at Rust leadership to make a call on. @Manishearth - what's the latest? |
I'm not sure if there's ecosystem-wide agreement on what to do, but my impression is that people prefer to use dashes. There are open bugs to make crates.io, cargo, and docs.rs more agnostic to dashes-vs-underscores (you already cannot publish crates that only differ on dashes vs underscores). Dashes look nicer so folks tend to use them more. |
Consensus is to:
|
Is there really confusion? |
If the choice is between If Rust settled the dispute and decided to go for How strongly you feel about |
The community has largely decided on Here are the counts of
Yes, because Some namespacing proposals also involve specially blessing |
I'm going to split off the short names from |
It sounds to me like the main advantage of
Here's my counter-argument. When I add new dependencies to my Cargo.toml file, I usually copy and paste the crate name from some web site, like crates.io, docs.rs, etc. It's easier to copy a name with underscores, because on most browsers and operating systems,
I'm not saying that arguments about developers' expectations are invalid, but if we're looking at developer experience as the primary decision point, there are advantages of |
Another argument for If using hyphen somehow propagates to file / folder names, that would be a problem for some build systems (for example bazel (home), Bazel (Wikipedia)) Bazel takes the files / folders and use the names "as is" to create python variable names. Kind of a shame for a system used in this day and age, but this is the current status.
Everything we bring inside Google has to build with bazel (the internal version). |
@Manishearth @mihnita @sffc and I met today to discuss this topic. The conclusion is as follows:
Thank you all, and I'll write the PRs for the short-term renames as one of the last steps before 0.1 release to minimize the PRs bitrotting. |
This isn't for certain, fwiw, this is just my personal endeavor |
This is now complete. |
We are using hyphens in package names, but underscores pretty much everywhere else:
I don't understand why we don't use underscores in package names, too. There are lots of Rust packages that use underscores, like serde_json. This would eliminate the oddness that you put "icu-locale" in Cargo.toml, but then when you use it in code, you need to write "icu_locale".
The text was updated successfully, but these errors were encountered: