Cargo & import : use url based name

currently on crates.io it is required to have a unique name for a crate. This create a situation where you want to give a crate a simple name but that name is simple and it is already taken.

Having URL based crate name will solve this problem. then they only need to be unique per user.

so we don't have to fight for choosing name.

Squatting is well-trodden territory, so much so that I was able to create a long list last time

6 Likes

You seem to be posting a lot of "why doesn't Rust do things completely differently" posts lately. Please consider doing some preliminary research on such questions before bringing them to the forum, both to find answers and to find previous discussions on the same topics. In this case, this issue has been discussed extensively, dozens of times (see the link @RustyYato posted), and it is isn't even close to simple.

It's not that such questions are not up for discussion; on the contrary, they absolutely are. However, opening such a discussion needs substantial background research, a detailed post with context and awareness from previous discussions, a clear explanation of what's new since those discussions, and similar.

10 Likes

how does Go do this. they uses url for package import.

Yes, this was already discussed in 2018.

Please don't duplicate existing discussions.

i suggest to use Go like approach for crate naming.

You can already choose to use git URLs for any of your dependencies. However, because crates.io guarantees package availability but can't vouch for services it does not control, you cannot publish crates to crates.io that depend on crates via git. You will also have to handle updates yourself, but as I understand it, that's how Go works today.

8 Likes