rust-random / rand

A Rust library for random number generation.
https://crates.io/crates/rand
Other
1.63k stars 428 forks source link

Documentation organisation #634

Closed dhardy closed 5 years ago

dhardy commented 5 years ago

Just a heads up: I've been working on The Book.

You may notice a lot of overlap with the current API docs: my plan is to reduce the wordiness of the API docs significantly to make them easier to browse, especially the module documentation for the lib (top-level), rngs and prng.

The book has lots of links into the API docs (via relative links; seems to work fine as hosted and locally with a simple symlink). The API docs should in theory link into the book too; I'm not sure the best way of doing this since I don't want to break our cargo deadlinks CI testing.

About testing: this is unfortunately a big step backwards since MdBook fails on most examples with linker errors; additionally the "run" command on the book's snippets doesn't appear to handle imports via use correctly (if it works at all). Link checking is probably possible (though it may not be trivial to make those relative links to the API work in CI testing). See https://github.com/rust-random/book/issues/2.

There's still a lot to do here, though most of the Guide section is ready for proof-reading. I'm not sure about the Overview section.

vks commented 5 years ago

Looks good! A few comments:

dhardy commented 5 years ago

Thanks for proof reading!

In general, I would prefer a more mathematical approach.

True. In the aim of keeping the material as accessible as possible I tried to minimise expected background knowledge and leave distributions until later (section 2.5), but this doesn't work out so well. Point noted.

This does not really say much. Maybe mention why you would prefer a hardware RNG over software one?

To be honest I'm not sure what to say. Quite often a software RNG is preferable for speed and reliability anyway.

In Random distributions, the distinction between "More continuous distributions" and "Probability distributions" seem arbitrary. Maybe merge the sections?

Is it? It may not be well worded, but three of the listed "probability distributions" are discrete, and I believe the latter often used in models to sample a probability value. Suggestions welcome but I think there should be some kind of distinction here.

(Note that many distributions such as Gamma and Weibull are not listed simply because I assume that people who want to use them will already know exactly which distribution they want and peruse the API docs; the main purpose of this listing is to help inexperienced modellers find something appropriate, though of course it is woefully short of a proper introduction to modelling.)

Nitpick: The range is part of the distribution. It seems it is never explained what a distribution is.

It's certainly a property of the parameterised distribution but not of the type of distribution. Seems a little work is needed here.

dhardy commented 5 years ago

Please review: https://github.com/rust-random/book/pull/3

dhardy commented 5 years ago

I think this can be closed now.