std.random suggestions

monkyyy crazymonkyyy at gmail.com
Tue Sep 16 18:59:48 UTC 2025


On Tuesday, 16 September 2025 at 18:10:22 UTC, Denis Feklushkin 
wrote:
> On Tuesday, 16 September 2025 at 18:04:20 UTC, Monkyyy wrote:
>> On Tuesday, 16 September 2025 at 12:04:20 UTC, Denis 
>> Feklushkin wrote:
>>> 2. Completely exclude "seeding" concept: this is a source of
>>
>> You can make it implict called, and leave the data public for 
>> whoever wants it.
>
> It is difficult to achieve this because in most cases it will 
> be just a libc getrandom() call (system-wide seeded PRNG)

your suggested api does nothing for the majority of trivial 
randomness use cases

Video games, fuzzing, and algorithms uses of randomness can be 
both fairly cheap and in each I would want deterministic playback 
for when I need it. Access to the seed is nessery for many video 
game randomness hacks, and unit testing some random values is 
great and all but if you looking at a 1 in 100000 bug youd want 
to be able to hack in a reported seed for *when* it breaks, then 
speed testing randomness-using algorithms could want to redo 
tests as well if something seemed slow.

Fast randomness and secure randomness are different problems.


More information about the Digitalmars-d mailing list