crates.io VS lib.rs - A small analysis

71 points nik-rev 18 comments

I've been using lib.rs as the crates.io replacement for quite a long time. But I've never thought about why exactly I do that, it just draws me in.

I wanted to make a list of things that I like about lib.rs, maybe these could be integrated into crates.io at some point

Foreword

This is how I personally understand the existence of 2 sites.

crates.io and lib.rs serve 2 different target audiences, and are developed differently

crates.io doesn't judge of the popularity of a crate. That means you won't see fancy graphs, it will be harder to understand how maintained the crate is just from the UI alone. crates.io sticks to purely presenting the facts about each crate and perform text search.

crates.io's maintenance is primarily infrastructure, and it is maintained by a team.

In contrast, lib.rs is maintained by a single person, and has a complex ranking system for crates. There's no team to approve, so getting things done is much easier - the maintainer just decides it will happen.

Front Page

lib.rs

crates.io

Both of these sites have a search bar at the top that stands out

lib.rs lists every category on the front page, the category's description - and some of the popular crates in that category. For example, "Rust patterns", "Network programming" and "Algorithms"

This makes it easier to discover popular crates, and see at a quick glance what the ecosystem has to offer. Popular categories are placed at the top.

crates.io's front page makes more of an emphasis on the first impression. Total crates count, total download count - take up a large amount of screen space. Crates list is not available until half a page down.

The 3 columns of crates are "New crates", "Popular crates" and "Just updated". I've never been interested in the 1st and 3rd category, since these crates are more likely to be brand new / in development

I think it's great that lib.rs places more emphasis on showing crates on the front page that are both popular and applicable to a wide variety of use-cases

Scrolling down, there are 3 more columns. Those are "Recent downloads", "Popular keywords" and "Popular categories".

The "recently downloaded" crates are mostly the same as in the "popular crates". "Keywords" and "Categories" are lists of collections of crates

lib.rs also has tabs on the front page. The default tab is "Categories", discussed above. There's also the "New and trending" tab, which has a list of popular crates that recently had a release, and notably "trending" crates.

I really find the "Trending" part valuable and fun. Crates like syn, serde and others are always likely to be at the top of the "Most downloaded" lists, but different crates will be trending constantly - it is nice to keep up with the times

The most popular crates being highly downloaded is also usually due to their age / maturity, not necessarily if these crates are still useful. lazy_static has 580 million downloads and appears quite high in the list, despite already being integrated into the standard library.

Search

lib.rs

crates.io

When you search for a phrase like "serde" in both of the front pages, both sites will display a list of crates

In crates.io's case, each crate's display takes up a large amount of whitespace (both in padding and margin). My screen can see 3 crates at once on crates.io in a single search, while lib.rs shows 8. lib.rs's representation is more compact

lib.rs also suggests a list of other things I might be interested in searching for: "serde …deserialize? …serialization? …json-schema?", which is great for discovery or possible typos

lib.rs has a very sophisticated crate ranking algorithm, which makes it a lot easier to discover new and interesting crates

Crate page

An overview about a single crate.

lib.rs

crates.io

lib.rs displays metadata about the crate like crates.io, but slightly differently.

Each crate will have the recently released versions at the top, this can help give a quick check of how maintained the crate is, and how likely it is to be stable. Each version contains a date, and at the top of this small list of versions you can see a link to all releases. I like this kind of "preview". The most recent versions are what I want to know in 99% of the cases, and not having to click a button for that is very welcome.

The releases page contains similar information to what crates.io shows, but it has a graph showing download count for each version. On crates.io, you have to actually click this button to see the recent releases, instead of the recent versions being displayed inline for you.

On the front page of the crate, both sites display common data like license and lines of code count

For crates.io, to actually get to the interesting crate links like the repository or documentation, you have to scroll down quite a bit. This section appears as the 3rd section on right, and outside of the initial viewport on my screen.

lib.rs displays dependencies of the crate right at the top, without needing to click any buttons. It shows features of the crate, and what ranking the crate has in its categories - for serde, this is "#13 in Encoding"

The category is a great detail, as it lets me quickly have a look around what other crates are there like the one I'm examining.

lib.rs shows the number of crates that this crate is used in, which is also helpful. Dependencies and reverse dependencies are available directly at the top.

lib.rs shows a graph of the download count of the crate

lib.rs will syntax highlight inline code blocks, which is minor yet very welcome

lib.rs packs a ton more information into the first screen you get when you visit a crate's page.

At the very bottom of the screen, in the footer, lib.rs has 2 very helpful sections: "Related: ..", and "See also: .." to help me find crates that could be similar to this one.

For example, when I'm on the nonempty crate's documentation, it shows me a list of other crates that are related to non-empty collections. Notably, it introduced me to mitsein which is now my go-to crate for all of my non-empty collection needs. I wrote a little bit about why I love this crate so much on the Rust Internals forum.

Summary

Essentially, my favorite aspect of lib.rs is that it displays quite a lot of information compactly - while having the site continue to look clean and modern.

On individual crate pages, crates.io aims to make its layout friendlier and easier to understand