Re: trivial random ports for deterministic seeding
Peter McGoron 01 Jun 2026 00:37 UTC
> Thank you!
You're welcome :)
> I don't know whether these ports belong in SRFI 271.
They are a little odd: there's little reason to seed them from another
binary port, for instance.
> They could be described in a short standalone SRFI.
If all you need is to output a cyclic bytevector from a port, then one
could do it with SRFI 181 / R6RS custom ports / any
implementation-specific method. You can't implement `random-port-state`
on it, but that has questionable use for these types of ports in general.
The benefit of adding it to this SRFI is that implementations without
custom port support would be able to support seeding from cyclic ports.
(It is also, technically, an RNG. It is a bit like a one-time pad: if
what you're doing requires less than the number of bytes in the input,
then you can craft a seed that passes any statistical test observing
only those inputs.) I don't know of any other uses for this type of port.
-- Peter McGoron