Cargo crate name reservation spam
Recently I was going through crates.io recents to see if there were any libraries that caught my eye as something I could use to write something cool. I noticed that there was a large number of crates created at the exact same time, with the exact same description, all with version 0.0.0 and a message "WIP. Contact me if you want to use this name!". Here's a screenshot of this.
the user who's reserved all of these names is https://crates.io/users/swmon. I went through his profile and it seems as though every one of his crates on the 11 pages of his profile is just a "reserved name", bar one or two. I find it very hard to believe that one person could have so many "work in progress" projects that would require names as broad as "while", "youtube", "thef***", etc.
Can these crates be removed to free up the names, and perhaps consequences imposed on people who mass reserve common names they're never going to use like this?
Posted Aug 25, 2018, 9:25 PM UTC
I know it's too late unless we introduce a "legacy" namespace, but I wish Cargo had gone with namespaced packages, with a reserved / curated top-level namespace, taking the place of rust-lang-nursery and augmented with well-recognized and supported community projects. There could even be a formal auditing process for these packages, code / documentation / licensing standards, etc.
The top-level packages would be the first place a new user would look for things, and the namespaces would make it easy for users to find packages related to a specific project, while the presence of namespaces would make clear to the user "there are no guarantees for this package".
Finding original names for projects is a pain in the ass. Let it be namespaced using the github username/org.
lol, the entire community was saying this before crates.io launched and the Rust team was about as responsive to their pleas as the Wailing Wall.
So yeah, this has been discussed extensively, but ultimately he who controls the infrastructure makes the rules, and the infrastructure is not controlled by the community.
I have to oppose this view heavily. There were equally large chunks of the community who were fine with this decision or wanted to have it that way.
You can join the crates and infra team by the way.
(Also, for context, I wasn't part of the project back then)
The consensus seems clear to me.
Are you fine with a bot registering all of 4 and 5 letters crate names then? Not against the policy.
That would be really annoying.
Have a single, simple to remember name is very valuable.
It is valuable, which is why it shouldn't be given away for free (without vetting/review etc).
How about you namespace it and if you earn it you get a namespaceless alias.
I don't like this idea as it would force you to use Github. I don't have anything against Github right now and use it, but being dependent on another organization is nothing I like.
Who’s going to write the RFC for this?
Then it might be hard to remember the author of the crate. With typosquatting, it looks like a recipe for disaster.
On the other hand, if there were few high-quality organizations and one remembered their names, it could solve the discoverability problem as well.
Why is it harder to remember an author's name than a "creative" crate name? The goal of flat-namespacing was explicitly stated to be encouraging people to come up with random names like "nokogiri". Maybe that hasn't happened so much yet on crates.io, but we do have stuff like a crate named "reqwest" solely because "request" and "requests" were taken.
Good question. I'd guess that remembering short creative name is easier than remembering nick of a person (likely based on foreign name) + (possibly creative) name.
As an experiment, here are crates and authors I remember (I don't check whether they are correct, not spelling of the names, so you can see how many mistakes I do):
And here are crates with creative names (name not obviously associated with what it does) that I can remember:
At the first sight it might look like username + crate name wins, but that's not actually the case. First I think that I don't use many crates with creative name, so the second list isn't shorter because of my inability to remember, but because of them not being many. Secondly, in the zeroth case I'd be (theoretically) unable to use any other crate. However, I remember both creative names listed above and "normal" names - many of them listed in the zeroth case, but there are others (websocket, protobuf, reqwest, serde, etc).
In other words, I remember more crate names than crate names and their authors. Of course, it's anecdotal evidence, but I'd be surprised if anyone remembered the nick of the author of every crate he uses.
Which, I might add, is bucking unpronounceable, guaranteed to be mangled by autocorrect or even mistaken for a typo by humans. Ugh.
You could make it optional. If there is only one package with that name, you can omit it (but cargo still saves the full name in Cargo.lock so if there is one added lated you project will still compile), but if there are multiple, cargo will throw an error and list the possibilities.
That could work for
bincrates but it'd be a problem forlib, which don't haveCargo.lockcommitted.Let's not repeat Go here. You already have to register to publish crates on crates.io, use that username.
Another option is to have multiple repositories like distros have (and some thing where everybody can submit like copr or the AUR).
I second that. I think Arch Linux is a living example of a perfect balance between reliable stable core and wild wild west in AUR. The barrier to entry for newcomers is minimal (just the PKGBUILD script), yet once your package is recognized it gets moved up through community, extra and then core repos. Very sane, pragmatic approach to packaging software.
Yes. Namespaces, please.