[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: random doesn't feel very random
From: |
Stefan Monnier |
Subject: |
Re: random doesn't feel very random |
Date: |
Sun, 26 Aug 2012 20:50:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) |
> Therefore the PRNG should be seeded once at start-up, from a good
> source of entropy.
I tend to agree.
> Given the widespread use of (random t) it should probably be made a
> no-op and a separate API to provide a local state for application that
> wish to control it for whatever reason should be made available.
IIRC Emacs fails to seed its PRNG at start (IOW it is seeded with
a constant), which is why many packages use (random t).
So I think the right thing to do now is to do seed it at startup, then
make (random t) a no-op.
We could consider adding a way to get the PRNG state and reset it later,
but since the PRNG state is Emacs-wide and Emacs is more like an OS than
like an application w.r.t its packages, such an interface would need to
allow several named PRNGs, so you'd call (random N <id>) to get the next
"random" number from <id>'s stream.
Stefan
- Re: random doesn't feel very random, random doesn't feel very random, Re: random doesn't feel very random, (continued)
Re: random doesn't feel very random, Leo, 2012/08/24
- Re: random doesn't feel very random, Richard Stallman, 2012/08/24
- Re: random doesn't feel very random, Andreas Schwab, 2012/08/24
- Re: random doesn't feel very random, Richard Stallman, 2012/08/25
- Re: random doesn't feel very random, Leo, 2012/08/25
- Re: random doesn't feel very random, Richard Stallman, 2012/08/26
- Re: random doesn't feel very random, Achim Gratz, 2012/08/26
- Re: random doesn't feel very random, Leo, 2012/08/26
- Re: random doesn't feel very random,
Stefan Monnier <=
- Re: random doesn't feel very random, Simon Leinen, 2012/08/27
- Re: random doesn't feel very random, Richard Stallman, 2012/08/26
- Re: random doesn't feel very random, Stefan Monnier, 2012/08/27
- Re: random doesn't feel very random, Eli Zaretskii, 2012/08/31
- Re: random doesn't feel very random, Stefan Monnier, 2012/08/31
- Re: random doesn't feel very random, chad, 2012/08/31
- Re: random doesn't feel very random, Eli Zaretskii, 2012/08/31
- Re: random doesn't feel very random, Stefan Monnier, 2012/08/31
- Re: random doesn't feel very random, Paul Eggert, 2012/08/31
Re: random doesn't feel very random, Leo, 2012/08/31