On Mon, Apr 12, 2010 at 1:55 PM, Larry Wall <la...@wall.org> wrote: > On Mon, Apr 12, 2010 at 07:24:37PM +0200, Moritz Lenz wrote: > : > 1. do all implementations of Perl6 generate the same sequence, given > the > : > same initial seed. > : > : I don't think they should. If you want that, use confuse a RNG with a > : sequence generator that it is not. > > While I agree that the default should be non-reproducable, the > approach taken in Perl 5 is nice to the extent that if you *do* > seed the built-in RNG with a consistent value, you get a reproducable > result. And reproducable trees of random sequences can be generated > by controlling the seeds of each node in the tree. >
I think that what this conversation is boiling down to is: an RNG is just a role that wraps an iterator factory and provides some passable defaults, to be implemented as the default class or classes for Perl's core. That's fine, but the idea of non-reproducible defaults worries me. If, by this, you mean that whatever seed is provided to "srand" is to be aggregated with another source (e.g. XORed with output from the system's entropy source), then I would love to hear from someone who has experience with the last 10 years of PRNG work who thinks that's not opening us up to some sort of strange edge-case risk. PRNGs are often misrepresented as frivolous, but as I'm sure you know from your work at JPL, high quality random sequences are much-prized, and any language that starts off with some poor assumptions will ultimately pay for it. Some good reading for recent work: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ http://eprint.iacr.org/2006/086 http://lcamtuf.coredump.cx/oldtcp/tcpseq.html http://www.avatar.se/python/crng/index.html -- Aaron Sherman Email or GTalk: a...@ajs.com http://www.ajs.com/~ajs