From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Improve `seed->random-state' in stable-2.0? Date: Mon, 23 Jan 2012 10:52:38 +0100 Message-ID: <877h0irbix.fsf@pobox.com> References: <87d3afvyr6.fsf@netris.org> <87ipk6tof0.fsf@pobox.com> <878vl2w6ig.fsf@netris.org> <874nvqt8n0.fsf@pobox.com> <87ehuuuh6x.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1327312385 9900 80.91.229.12 (23 Jan 2012 09:53:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Jan 2012 09:53:05 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 23 10:53:01 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RpGaD-0001vy-90 for guile-devel@m.gmane.org; Mon, 23 Jan 2012 10:53:01 +0100 Original-Received: from localhost ([::1]:49149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpGaC-0006Qx-Nq for guile-devel@m.gmane.org; Mon, 23 Jan 2012 04:53:00 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpGa5-0006Qf-7F for guile-devel@gnu.org; Mon, 23 Jan 2012 04:52:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpGZy-0006Bc-S5 for guile-devel@gnu.org; Mon, 23 Jan 2012 04:52:53 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:56464 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpGZy-0006BV-PS for guile-devel@gnu.org; Mon, 23 Jan 2012 04:52:46 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 2A9EA70F7; Mon, 23 Jan 2012 04:52:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=pscdJjShgbtXo9L4Y23tGibZwK4=; b=WSj1gW eM/sAf76Soq0qwGDW/eg7VC0ojV8CwptmhcIE/EQ7BhwB97dMSWiOTnzLDM0MPOZ Rjyn+A8yLeaYaaeJy6lmRt9PkmLgboWhhsY1NfIKzsR+HcCjhxB7nRuXixxaA4tW 59S/H9vfDTKD10l4DaxLkTp5W0FTeSLG+9zBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=Fia00odmsQq1Bextg0j70q/n515GrBY/ 4aa7E7Up52CneI+2p8/5R/v0HghPbHUEk6NQ0yTsA0Q9rYsqBmaghWWoDqTes3NB FFjiQsDT3Bd62x1dO3WU2HMzDUkPd/KMm4xkgljdEzCmvjv7CBbWkO+vRbALZh1s kClpq7QZXQA= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 22CB470F6; Mon, 23 Jan 2012 04:52:45 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 5C31070F5; Mon, 23 Jan 2012 04:52:44 -0500 (EST) In-Reply-To: <87ehuuuh6x.fsf@netris.org> (Mark H. Weaver's message of "Fri, 20 Jan 2012 17:45:10 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: FF7190B0-45A7-11E1-BBDF-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13634 Archived-At: Hi Mark, On Fri 20 Jan 2012 23:45, Mark H Weaver writes: > Andy Wingo 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/