Skip to content
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

"Crates and features" implies that rand subsumes rand_chacha #39

Open
Nemo157 opened this issue Apr 12, 2021 · 5 comments
Open

"Crates and features" implies that rand subsumes rand_chacha #39

Nemo157 opened this issue Apr 12, 2021 · 5 comments

Comments

@Nemo157
Copy link

Nemo157 commented Apr 12, 2021

Based on the dependency graph on https://rust-random.github.io/book/crates.html it looks like rand provides access to rand_chacha. While, according to https://docs.rs/rand/0.8.3/rand/rngs/struct.StdRng.html, rand_chacha is actually a private dependency of rand, and if you want access to the chacha family of PRNGs you should depend on rand_chacha yourself, similar to rand_distr. (I assume similar for rand_pcg/rand_hc, and I think rand_pcg actually even isn't a dependency of rand anymore).

@dhardy
Copy link
Member

dhardy commented Apr 13, 2021

Correct. rand_pcg should be removed. rand_chacha and rand_hc are both optional.

The reason for that graph is to talk about the total dependencies — we had some suggestions that rand had too many a while back.

So what should we do — point out that some of these are private?

@Nemo157
Copy link
Author

Nemo157 commented Apr 13, 2021

Ah, my impression from the initial prose was that the page was more about showing the relationships between the family of crates, not the actual dependency graph. As a private implementation detail I don't see that it's useful for users to know that rand depends on rand_chacha to provide its StdRng, and would have just gone for a graph like

getrandom ┐
          └ rand_core ┐
                      ├ rand ┐
                      │      ├ rand_distr
                      │      └ statrs
                      ├ rand_chacha
                      ├ rand_hc
                      ├ rand_pcg
                      └ rand_xoshiro

(and would extend it to include all the rust-random maintained crates).

@dhardy
Copy link
Member

dhardy commented Apr 13, 2021

Sounds reasonable. @vks do you agree?

@dhardy
Copy link
Member

dhardy commented Apr 15, 2021

I think we can go ahead and do this. Like to make a PR @Nemo157 ?

@vks
Copy link
Contributor

vks commented Apr 16, 2021

I agree it makes sense to omit private dependencies, and to update the graph with the other Rand crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants