[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: library interfaces and pseudo-random number generators

From: Ralf Wildenhues
Subject: Re: library interfaces and pseudo-random number generators
Date: Mon, 20 Feb 2006 10:10:02 +0100
User-agent: Mutt/1.5.11

Hi Vincent,

* Vincent Lefevre wrote on Mon, Feb 20, 2006 at 09:45:54AM CET:
> I'd like to know if the algorithm used for a pseudo-random number
> generator provided by a library is part of the library interface.
> A PRNG can be used so that the results are reproducible (using the
> same seed). From this point of view, I'd say that a new library
> version which gives different results (still with the same seed)
> has an incompatible interface, but I'm not sure.

Good question.  I'd say that depends on documentation: if the interface
was documented to either provide a certain PRNG, or weaker, if it was
documented to provide deterministic series, then that would likely
change the library interface.  If OTOH it was explicitly documented to
have an unstable or non-deterministic algorithm, then it would not
necessarily be a change of interface: the user should not have relied on
it then.  A more extreme case would be if the library documented to
optionally make use of a real (non-pseudo) RNG with the same interface.

Certainly there is a large grey area in between, also I don't know
whether the definition of a PRNG implies any of the above already.

This is a good example for why a library interface simply cannot be
described by technical means (e.g., the preprocessed header files plus
the ABI) only: documentation is an essential part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]