From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: Improve `seed->random-state' in stable-2.0?
Date: Mon, 23 Jan 2012 10:52:38 +0100 [thread overview]
Message-ID: <877h0irbix.fsf@pobox.com> (raw)
In-Reply-To: <87ehuuuh6x.fsf@netris.org> (Mark H. Weaver's message of "Fri, 20 Jan 2012 17:45:10 -0500")
Hi Mark,
On Fri 20 Jan 2012 23:45, Mark H Weaver <mhw@netris.org> writes:
> Andy Wingo <wingo@pobox.com> writes:
>
>> How about, we extend seed->random-state to operate on bytevectors, and
>> have that interface do the right thing.
>
> I agree that it would be nice for `seed->random-state' to support
> bytevectors as well, but for many (most?) purposes that would be a very
> awkward interface to use.
Really? My thought would be that if I have to initialize a PRNG, I need
some random bits. Dunno. Deprecating the number interface does have
the advantage that we can perhaps move people to use your nice new
functions, instead of initializing with (getpid) or whatever it is that
they are using.
> Even if we keep a broken `seed->random-state', there's another problem:
> our PRNG sucks rocks. If we constrain ourselves to produce the same
> sequence of random numbers for a given seed, that means that we're stuck
> with this very weak PRNG for the entire 2.0 series.
>
> Can't we just make a clean break now? 2.0 is still not widely deployed,
> so now is a great time to assert our right to change the PRNG at will.
> As you say, it's unlikely that anyone is relying on this anyway.
> If anyone is, wouldn't it be better to deal with that now?
While I agree about the badness of the PRNG -- though we shouldn't
overstate that; for being so simple, MWC does well -- but I really don't
think that we should change the default behavior now.
OTOH, we can make seed->random-state on bytevectors return an rstate
with a different implementation of scm_t_rng -- for example, we could
use GMP's mersenne twister API.
In any case, don't let stability concerns stop you from hacking on a
fix! We'll probably get the first 2.2 preview out within a a year, and
we certainly need to change the default behavior for then
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2012-01-23 9:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 3:28 Improve `seed->random-state' in stable-2.0? Mark H Weaver
2012-01-20 8:37 ` David Kastrup
2012-01-20 14:54 ` Andy Wingo
2012-01-20 18:52 ` Mark H Weaver
2012-01-20 20:35 ` Andy Wingo
2012-01-20 22:45 ` Mark H Weaver
2012-01-21 7:38 ` David Kastrup
2012-01-21 8:20 ` Mark H Weaver
2012-01-23 9:52 ` Andy Wingo [this message]
2012-01-20 23:46 ` Mike Gran
2012-01-23 9:55 ` Andy Wingo
2012-01-23 13:06 ` Mike Gran
2012-01-23 14:06 ` Andy Wingo
2012-01-24 6:08 ` Mike Gran
2012-01-24 9:56 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877h0irbix.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).