On Mon, May 18, 2026 at 7:52 AM Shiro Kawai <xxxxxx@gmail.com> wrote: > > Limiting the initializer to infinite binary ports sounds good, especially because > we can delegate the responsibility for the required data length to the each >PRNG implementation. In the sense that a finite port won't do, yes. But we need to be able to accept a state object as an alternative to an infinite port, for reproducibilty. > But I need a guarantee that an arbitrary embed hardcoded number > (e.g. a port that repeatedly generates a certain hardcoded sequence > of bytes) works across all implementations. That's not possible, because different implementations require different amounts of state. In Chibi's implementation of SRFI 27, for example, the state is 128 bytes, but in Gauche's version it is 2500 bytes. If Chibi writes out a state and Gauche tries to read it in, it won't work. Even if you pad it with zero bytes or repetitions, that doesn't work for the algorithm (I forget which one it is) that blows up on an all-zero initializer, since that is the default for both Chibi and Gauche. This also means, by the way, that you can't initialize a random port usng n *arbitrray* binry port, becuse if the port you are trying to use always produces 0, it doesn't mtater how many bytes you read out of it, it will go into n infinite loop before generating anything. If you want reproducible random numbers, you have to create a port initialized from a reasonably equiprobable source and then ask it for its state, which you can then persist.