-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using downloads in the last N days, instead of all time. #101
Comments
All I'm saying is... If you made libsqlite3 available in the sandbox, we would find it super helpful for bug reports. :) |
Will the "last N days" selection help libsqlite3? How would one check that? |
Only somewhat related to this issue and the discussion in #82, but it seems kind of strange (if I'm understanding this correctly) that updating the top crates list could cause code that previously used to work to no longer work. i.e. the 100th crate in the list may drop to 101, the service is redeployed, and now any code snippets that relied on that crate no longer work. That being said, I don't know what the best solution would be. |
Even easier, a crate can simply release a new backwards-incompatible version. Since we always use the more-or-less-latest version, this is quite possible.
This is a good point, but I don't see any good solution unless some benefactor decides to provide financial contribution ;-). The Big Solution I can think of is to allow arbitrary versions of crates (and we might was well throw in arbitrary Rust versions at that point). Then we are one step away from being a (poor facsimile) of a web-based IDE.
Beneficially, any code is still available, even if it's not executable. |
Which is part of the reason that I avoid adding the shortlink button and prefer the Gist button — I'm betting that GitHub and Gists will last a long time! |
Looks like the last 90 days right now would be
|
I'm a little nervous about using "last N days" as the factor to decide which crates to make available, because it will favour recently-updated crates. Of course, incentivizing actively-developed libraries is good, but I'm worried that stable, rock-solid crates that are used frequently will drop off, which is :( I'm assuming that the underlying goal is to make the "100 most popular/used libraries" available. However, a crate can be used by a ton of projects, but if it isn't updated, then each project using the dependency won't download it again until the next release. However, a frequently-updated project will more quickly rack up downloads, as devs will be re-downloading the package to get the new version. For example, I consider (At the same time, perhaps incentivizing frequently-updated crates will encourage new libraries to be developed and increase competition, but I'm not sure the Rust playground should be the platform to push for that type of objective) |
Maybe it makes sense allow the use of the intersection of "top crates of all time" and "top crates from the past 90 days"? That way you can cover both crates that are very popular, but aren't updated frequently, and allow people to experiment with and share code from the newest hottest crates. And there's going to be a lot of overlap, so you won't be hosting too too many crates. |
Downloads will always be an imperfect metric that over-emphasizes crates which are likely to be dependencies of other crates, regardless of whether it's all-time or recent. For example, Rocket is easily one of the most popular crates out there -- or at least one of the most talked about. Nearly a third of the front page posts on /r/rust mention it in the comments at least once. However, it is only ranked 511 on all time downloads, and 443 in recent downloads. Or to put it from another perspective -- Diesel has a handful of dependencies (only one is actually mandatory, but in practice anybody relying on Diesel will have at least 5). Let's assume for the moment that all users of Diesel have the My point being, if a crate simply chooses to allow integration with chrono (or even just uses it internally for something), that crate will now at absolute best be ranked 19th in downloads, regardless of whether it's ranked by recent or all time. |
I was checking to see if nom was supported. It looks like it has enough downloads to be in that top 100 list above, but I guess that list above is out-of-date now? It also seems like a pretty well-known crate for it to be excluded. I'd wonder if there's a way of working categories into this - maybe the top 10 crates in each category should be included - although then it raises the issue of what the categories are, and who defines them. :) That way you get an even spread instead of favoring. Another metric I could see factoring into this that would be harder to track - you could track how often somebody tries to include a crate and fails, or how often a crate actually gets included. This would then over time start to favor stuff that people often try to use the playground for. You couldn't directly compare failures and successes (once a crate started to work, it would likely start getting used more often) but maybe there's a multiplier that could be used to approximate a ranking of all currentlyincluded/currently-excluded crates. |
Hmm... If we assume that every time a crate is downloaded, all of its recursive dependencies are downloaded with it (including optional dependencies?), could there be a metric where they are subtracted to avoid double-counting? |
@sollyucko I'm not weighing in on if that would be better or worse, but it's not as straight-forward as stated due to changing dependencies over time. For example, if crate A v1 depends on B v1 then A v2 drops the dependency, you need to account for that.
It's unclear if it matters, but this assumption isn't true. If crates A and B depend on Z, then I install A I'll download (A, Z), then when I install B I'll only download (B). Removing the counts of both A and B from Z would lead to double subtracting. |
I have very little background here but ... I recently ran into an issue where all the examples in these docs for wasm-bindgen no longer run. If I understand correctly, the issue is that at one point wasm-bindgen was in this list and was then automatically removed when it fell off the list. That process in general seems undesirable as then any page using the playground could break at any time it updates. If an algorithm for keeping things on the list forever is unacceptable, maybe it would be better if the rust-playground didn't include any crates period but the docs were updated on how to add a list of crates for a specific deployment. Then, each user of the playground could include the crates they need with their build (maybe this is already documented? This is my first brush with rust-playground) updateI forgot that for most people they're relying on this one global server setup which only has one set of crates. That complicates the issue. Still, currently you write some code that requires a crate and tomorrow that code no longer runs because the crate fell off the list. That seems like a problem. |
I'm pretty sure this is the first time I've heard the argument that since sometimes old code won't work, we should remove all crates for everyone, forever. Feels a lot like Solomon cutting the baby in half. There's nothing stopping people from running their own deployments of the playground, but it's certainly not the case we've optimized for. However, your point doesn't really have much to do with this issue; the issue is changing the algorithm your suggestion is to completely abandon the algorithm. It'd be better to discuss it in a separate issue. |
My point was that the current algorithm is guaranteed to break stuff. People post on the playground, reference it, then others go to look, sample no longer runs. That's super confusing and not good for rust's reputation relative to other languages' playgrounds. |
Either a redistributable that people can self-host or a warning seem like
better solutions.
- Steven
…On Thu, Jan 4, 2024 at 11:54 Greggman ***@***.***> wrote:
My point was that the current algorithm is guaranteed to break stuff.
People post on the playground, reference it, then others go to look, sample
no longer runs. That's super confusing and not good for rust's reputation
relative to other languages' playgrounds.
—
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVRX5BNHDOS2QZ5WSCT7GDYM4CH5AVCNFSM4C7X6YL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBXG43DONZYG44A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It should include the top 1200 most downloaded crates of all time so that test_case would be included. 😉 |
TL;DR: We use the top 100 crates based on all time downloads to avoid being arbiters of what crates are available. If you think that a "popular" crate should be present on the playground, consider enhancing crates.io to have an API that would prioritize crates downloaded in a more recent interval.
Rationale
See discussion started in #82 —
And #113 —
The text was updated successfully, but these errors were encountered: