[m-rev.] time additions (was Re: for review: Add random.init/3)

Julien Fischer jfischer at opturion.com
Thu May 26 15:55:55 AEST 2016


On Thu, 26 May 2016, Paul Bone wrote:

> On Thu, May 26, 2016 at 12:15:52PM +1000, Julien Fischer wrote:
>>>
>>> My reaction to the use of floats for this kind of thing is rater visceral.
>>>
>>> I agree that it may be useful to expose time in seconds since the epoch for
>>> other reasons.  And as an aside, gettimeofday() could be useful if portable
>>> too.
>>>
>>> I think there are a few potential solutions.
>>>
>>>  1 Use an int and hope for the best for 32-bit C / Java and C# platforms.
>>
>> Can we do a little better than hoping for the best?
>>
>>>    Maybe the world will end before 2038 and we'll also never need to store
>>
>> Or assuming that world will end before 2038 ...
>
> Partly I'm being facetious and partly this is a serious proposal because...

Ok, even if you're only partly serious, I'm fascinated as to how you
intend to end the world ;-)

>> ...
>>
>> 4. Seed the PRNG using something other than time, for example:
>
> ...obviously this is the best solution in addition to generally improving
> the random and time modules etc.  However I'm also concerned that I/we won't
> finish this before the next task needs our attention.  "just using ints" is
> something that can be implemented easily and is going to make it easier to
> seed the random number generator, even if the seed isn't secure, or the
> generator itself isn't strong.  We can always come back later and make
> improvements.

I.e. put up or shut up ;-)  For improving the time and random modules
I don't think it's question of improving them, rather replacing them
entirely.  That, unfortuantely, is going to be a very large job.

Julien.


More information about the reviews mailing list