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

RandomStream class and interface -- what to call them? #19601

Open
vasslitvinov opened this issue Apr 5, 2022 · 2 comments
Open

RandomStream class and interface -- what to call them? #19601

vasslitvinov opened this issue Apr 5, 2022 · 2 comments

Comments

@vasslitvinov
Copy link
Member

vasslitvinov commented Apr 5, 2022

We would like PCGRandomStream to be THE random number generator in the standard library. As such, what should it be called? See also #19602

Also, what will we call the random generator interface when interfaces reach production quality? Footnote: if I am writing a library that needs a random generator, however does not care which one to use, it would be generic over the type that implements the interface.

Python: the type name is Random, see https://docs.python.org/3/library/random.html

Rust: has some random number generators and also a trait/interface. All RNGs implement the RngCore trait, as a consequence of which the Rng extension trait is automatically implemented. Secure RNGs may additionally implement the CryptoRng trait. Some generators are OsRng, ThreadRng, StdRng, SmallRng.

Random or random for the class name is acceptable to several core devs.

@vasslitvinov vasslitvinov changed the title What to name the RandomStream class and interface? RandomStream class and interface -- what to call them? Apr 5, 2022
@vasslitvinov
Copy link
Member Author

When we set up an interface for random stream generators, we may want to allow for some flexibility by introducing:

  • a "core functionality" interface, and
  • a "bells and whistles" interface that requires additional features

@lydia-duncan
Copy link
Member

Random is no longer intended for 2.0, removing the tag

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

No branches or pull requests

2 participants