Lib.rs (was Crates.rs) — what's next?

I’ve got lib.rs domain! So now you can type lib.rs/anything to view the crate or search for it!

1 Like

I just tried adding the search engine to Firefox, but the resulting URL has a typo,
e.g. https://crates.res/search?q=libc

This site is a great resource. Thanks.
I think the title tag should be adjusted for the new name. Currently:
<title>Crates.rs — home for Rust crates // Lib.rs</title>

Found a somewhat strange fact, perhaps an unfinished change. The information about lazy_static crate states:

lazy-static.rs is available on crates.io.

But the link (as copied here - the same is on lib.rs) is pointing on crates.rs, not on crates.io, and therefore looks like broken, while in the repository (and on the crates.io itself) it is correct.

I just had another look. It’s coming along pretty nice! congrats. There’s two things that make crates.io handy for me, which are:

  • it’s supported by ayu-rs, so I get a nice dark theme automatically
  • when I search for a specific crate name I always get notified clearly whether there is an exact match or not, which I use quite alot
  • I do use reverse deps, which I don’t find on libs.rs. For me it’s a hint of how many other people found that this crate served a purpose for them, and sometimes it can serve as “example code” on how to use the crate.

thanks for pursuing this

1 Like

@kornel Any reason why crates.rs should be called lib.rs? People are used to calling library in rust as crate as seen in crates.io.

1 Like

crates.rs was too similar to crates.io. I don’t want them to be confusable.

I’m not attached to the “crate” term. The extern crate syntax is going away. There’s Cargo.toml with a [package] section — without actually saying crate anywhere.

lib.rs is shorter, and nicely matches src/lib.rs.

9 Likes

I wonder if it would be nice to have a FAQ for lib.rs to avoid confusion with crates.io below on clicking Formely Crates.rs?

3 Likes

What’s the update frequency of libs.rs? I’m planning to announce a crate I just published by linking to crates-io in the morning, but if libs.rs has it by that point, I’d probably slightly prefer linking it there.

Currently update runs hourly + there’s some lag from caching by the CDN.

2 Likes

I see that lib.rs only seems to sort search results by “relevance”. Personally, I don’t like these sorta-opaque sorting criteria, and prefer to sort by a criterion that makes sense to me such as total crate downloads or recent crate downloads. These kind of sorting criteria are available today on crates.io’s search, do you intend to eventually add them to lib.rs?

I’ve found crate-io’s unfiltered download numbers to be noisy and in some cases leading to very misleading and IMHO unfair ordering of crates, so I don’t plan to use them directly.

I wouldn’t mind adding various “opaque” sorting criteria like popularity, trust, stability, etc. if there are strong use-cases for them. It’s just that crate-io’s download counter doesn’t do what you’d expect.

1 Like

The dark version renders pretty poorly on macOS using the system-wide Dark mode, in both Safari and Firefox:

5 Likes

Some user controlled curation would be nice. The first thing I look for when searching through any index is “how can I save myself from sifting through a thousand options”. Sorting by a trending by date marker would be really good.

2 Likes

@kornel The cargo-n64 README doesn’t appear on lib.rs, but it shows on https://crates.io/crates/cargo-n64

I’m not sure if it’s a packaging issue, but the repo is structured with a cargo workspace, and the crate references the markdown file in the root directory: https://github.com/rust-console/cargo-n64/blob/91a66648551448e371336f6258fe63b428e6d672/cargo-n64/Cargo.toml#L8

I consider this a bug in Cargo. It creates packages that are missing files. Crates.io “cheats” by not reading the crate, but instead uploading and storing the readme separately at the time of publication, when it has full access to uploader’s disk. I don’t, so I can’t get that readme from ../. I try to fudge it by searching git repo, but that doesn’t always work.

Thanks for pointing me in the right direction. Just found the ticket you created a while ago: https://github.com/rust-lang/cargo/issues/5911