Re: [Scheme-reports] randomness in wg1 Aubrey Jaffer 05 Nov 2010 14:57 UTC

 | Date: Fri, 5 Nov 2010 02:22:43 -0700 (PDT)
 | From: Marco Benelli <mbenelli@yahoo.com>
 |
 | I'd like to make some comments about randomness in wg1, recently
 | discussed on wg1 mailing-list.
 |
 | ...
 |
 | It's true that prescribe a specific PRNG is unusual, but it could
 | be justified by two reasons: a) the implementation is simple, b)
 | today most of mainstream languages are defined by a single
 | implementation (or a dominant one); I see great value in scheme not
 | being defined this way, and if I understand correctly the steering
 | committe position statement, the main goal of the report is to
 | reduce the drawbacks of diversity of scheme's constituencies.
 | Reliabilty of PRNG between implementations would be a huge step, at
 | least for scientific computing, in the direction of "construct
 | better programs in better ways: quickly, easily, robustly,
 | scalably, correctly".

The SLIB portable PRNG documented at
<http://people.csail.mit.edu/jaffer/slib_5.html#SEC119> extends
Common-Lisp's PRNG.  It has the properties:

* The random-state can be seeded from any string or number.

* From the same seed or random-state, all implementations return the
  same sequence.

* The random-state is a byte-vector (length 258).  Thus it is readable
  and writable if byte-vectors are.  If not, then replace the
  byte-vector with a plain vector (which is then readable and
  writable).

* Pseudo-random integers are generated using fixnum arithmetic.
  Bignums are used only if RANDOM is called with a bignum.

* Psuedo-random floats in a variety of probability distributions are
  generated using the integer generator.

* It passes Marsaglia's DieHard test suite.

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports