Similar crates (crates.io)

Hello,

I have a proposal concerning “Crates.io”, why not add the possibility for the community to specify similar crates, for example add a button next to the crate description entitled: “Propose a similar crate”.

This will give you access to a section at the bottom entitled “Similar crates”, which will allow you to find alternatives (for a depreciated or unmaintained Crate), or why not find a crate even more suited to the needs of your project.

this functionality can be found in many online application stores, and why not apply it to the world of programming.

What do you think? :disguised_face:

1 Like

Such a feature could be spammed to direct users from a perfectly good crate to a malicious one, or just to add links that are unsolicited advertising more than they are useful recommendations. That doesn't mean it definitely shouldn't exist, just that it would have a significant cost in moderation labor, and sometimes be worse than if it didn't exist.

11 Likes

Note that https://lib.rs/ already has a similar feature; if you look at the bottom of a crate page like this one for miette, you'll see that the footer bar contains a "Related" list and a "See also" list, of crates that you might be interested in.

In general, @kornel does an incredible job making lib.rs a useful and opinionated alternative to crates.io - and I rather like the split between crates.io as a fairly dull and factual listing of the things that the crate author supplied, and lib.rs as a more opinionated service for cases where I'm searching for a crate with functionality I need, but don't have a specific crate name in mind.

8 Likes

"crate closed as duplicate"

3 Likes

BTW, I'm working on improving this into a proper recommendations system.

4 Likes

Hm, Isn't that the thing on online shops that say "you may also be interested in" and "other people have also bought". Those often throw the wildest and most useless suggestions (you added some neodymium magnets to your shopping cart, do you also want toothpaste?), so hopefully you can figure out something better.

1 Like

you're right about the case of malicious use, we need a decentralized moderation model, for example a voting system?

lib.rs is a really feature-rich site, it would be nice to merge crates.io with lib.rs

interesting, but what kind of strategy will you use to find the similarity?

tags? or why not use an A.I. to read the description of each crate and generate internal tags that can then be used to group crates by similarity?

I think that is never going to happen, crates.io doesn't want to be opinionated. Stick to the terms of service and that is it.

That said, there are parts of lib.rs that are not about being opinionated that crates.io should take inspiration from. For example: the lib.rs UI is more responsive and presents data in a more useful order (especially on mobile). Things like the most recent publication date and graph of downloads are right near the top, on crates.io you have to scroll all the way to the bottom when on a phone.

The way dependencies and features are presented is also leagues ahead on lib.rs.

5 Likes

Currently the "see also" is based on crates' keywords, and shows crates that have the most similar keywords. But this fails sometimes, because not all keywords are meaningful as a category, e.g. "no-std" covers too many dissimilar things. I use TF-IDF to correct for that, but also niche keywords like "blazing-fast" can be meaningless.

I'm working on a UI to let anybody create a category on lib.rs, based on more sophisticated search queries that can include and exclude many terms. Then I'll have crates grouped by niches that hopefully people care about.

3 Likes

The RustSec Advisory DB maintains information about unmaintained crates including a curated list of alternatives

2 Likes

There are machine learning algorithms you could use to extract key words from the readme, and use them for identifying similar crates. The key words could also be useful to improve the relevance of search results.

1 Like