[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Patch to use better PRNG on BSD's
From: |
Jim Ursetto |
Subject: |
Re: [Chicken-hackers] Patch to use better PRNG on BSD's |
Date: |
Tue, 10 Apr 2012 15:47:33 -0500 |
We've been through this conversation multiple times. For example,
I already proposed a patch using random -- which is way more portable
than arc4random (!!) -- and it was rejected.
The ultimate solution is a self-contained PRNG of reasonable
quality in core.
Or users may use the random-bsd egg in the meantime.
On Apr 10, 2012, at 3:18 PM, Peter Bex wrote:
> On Tue, Apr 10, 2012 at 07:15:44PM +0300, Timo Myyrä wrote:
>> I noticed that chicken uses old rand / srand functions when better
>> alternatives are present.
>> Patch makes BSD's use arc4random instead of rand.
>
> NetBSD doesn't have arc4random_uniform either, so that'd need to be added
> to the test.
>
> I think a cleaner and more robust way is to actually put a PRNG inside
> Chicken itself. That way all platforms benefit from a good random
> generator instead of it being a hit-and-miss situation. Chicken ought
> to provide as good an abstraction over nasty annoying OS details as it
> can.
>
> Having said that, your patch is an unmistakable improvement over the
> current situation, especially on MacOS X, assuming they bothered to
> implement arc4random properly this time...
>
>> I'm not 100% sure this is correct so test, at least the Mac OS X part
>> as it doesn't have arc4random_uniform() function.
>> Builds and seems to work OK on OpenBSD when applied to 4.7.0 version.
>
> Your patch got mangled somewhere along the way. I think it might be the
> mailinglist software at nongnu.org that did that. Please put patches in
> your mail as a separate attachment instead of inlining them.
>
> Cheers,
> Peter
> --
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
> is especially attractive, not only because it can be economically
> and scientifically rewarding, but also because it can be an aesthetic
> experience much like composing poetry or music."
> -- Donald Knuth
>
> _______________________________________________
> Chicken-hackers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-hackers
- [Chicken-hackers] Patch to use better PRNG on BSD's, Timo Myyrä, 2012/04/10
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Peter Bex, 2012/04/10
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, John Cowan, 2012/04/10
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Peter Bex, 2012/04/10
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's,
Jim Ursetto <=
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Timo Myyrä, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Peter Bex, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Peter Bex, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Thomas Chust, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Jim Ursetto, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Thomas Chust, 2012/04/11
- Re: [Chicken-hackers] Patch to use better PRNG on BSD's, John Cowan, 2012/04/11
Re: [Chicken-hackers] Patch to use better PRNG on BSD's, Aleksej Saushev, 2012/04/14