From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: random doesn't feel very random Date: Fri, 31 Aug 2012 20:50:25 +0300 Message-ID: <83vcfzosri.fsf@gnu.org> References: <876288yh72.fsf@kanis.fr> <87wr0livd4.fsf@Rainer.invalid> <83k3wfqtyx.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1346435441 9478 80.91.229.3 (31 Aug 2012 17:50:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2012 17:50:41 +0000 (UTC) Cc: Stromeko@nexgo.de, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 31 19:50:41 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T7VMY-0003gf-Eq for ged-emacs-devel@m.gmane.org; Fri, 31 Aug 2012 19:50:34 +0200 Original-Received: from localhost ([::1]:35471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7VMW-0000si-5Q for ged-emacs-devel@m.gmane.org; Fri, 31 Aug 2012 13:50:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7VMS-0000ns-GN for emacs-devel@gnu.org; Fri, 31 Aug 2012 13:50:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7VMQ-0001a1-Ub for emacs-devel@gnu.org; Fri, 31 Aug 2012 13:50:28 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:35775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7VMQ-0001Yv-MR; Fri, 31 Aug 2012 13:50:26 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M9M00I00S3T6J00@a-mtaout20.012.net.il>; Fri, 31 Aug 2012 20:50:25 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M9M00H70S80K2D0@a-mtaout20.012.net.il>; Fri, 31 Aug 2012 20:50:25 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152917 Archived-At: > From: Stefan Monnier > Cc: rms@gnu.org, Stromeko@nexgo.de, emacs-devel@gnu.org > Date: Fri, 31 Aug 2012 11:06:45 -0400 > > >> > It is a feature that, if you don't call (random t), `random' returns > >> > a predictable sequence. That is good for debugging. > >> I wonder how often this has been useful. > > ??? A pseudo-random sequence is always deterministic, that's what the > > "pseudo" part is about. I'm sure you already know that. > > Yes, obviously I know that. So you've misunderstood what I said. Obviously. > I'm saying that I highly doubt that the fact that `random' always > returns the exact same stream unless you explicitly call (random t) > has been often useful (and used) for debugging in practice. Not in Emacs, but in other software, the equivalent functionality has proven useful to me many times. You basically cannot debug software that uses PRNG without this. E.g., if two supposedly-identical runs diverge at some point in the random numbers they show in some variable, you _know_ you have a clue for debugging. > As for whether they're bugs or not: I tend to agree that they're bugs, > but since currently our PRNG is not automatically seeded, those packages > that need their `random' to vary (IOW basically every package that > uses random) have no other choice but to call (random t) explicitly at > various times. If you are trying to convince me that our PRNG should be seeded at startup, them I'm sold on that a long time ago.