19608, "vasslitvinov", "Random's default seed generator naming and implementation", "2022-04-05T20:13:07Z"
opened 08:13PM - 05 Apr 22 UTC
type: Design
area: Libraries / Modules
type: Chapel 2.0
We have decided to provide the default seed generator as a public function in th… e Random module.
Should it be a standalone function or a type method? We are leaning to a standalone function.
What to name this function? Some ideas:
* getRandomSeed()
* defaultSeed() - con: does not sound like it will vary (which it should)
* Random.seed() - NB [Python's random.seed()](https://docs.python.org/3/library/random.html#random.seed) does something else
For the implementation, we have decided to switch from time-of-day to a hardware or OS source, akin to `/dev/urandom` or Python's [os.urandom](https://docs.python.org/3/library/os.html#os.urandom). This is tracked in #12540.
For now, we are not committing to a particular implementation of this function as part of its public interface/documentation.
We have decided to provide the default seed generator as a public function in the Random module.
Should it be a standalone function or a type method? We are leaning to a standalone function.
What to name this function? Some ideas:
getRandomSeed()
defaultSeed() - con: does not sound like it will vary (which it should)
Random.seed() - NB Python's random.seed() does something else
For the implementation, we have decided to switch from time-of-day to a hardware or OS source, akin to /dev/urandom
or Python's os.urandom . This is tracked in #12540 .
For now, we are not committing to a particular implementation of this function as part of its public interface/documentation.