hap.random: a new random number library for D

Ryan Voots via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Jun 9 11:51:52 PDT 2014


On Monday, 9 June 2014 at 18:09:21 UTC, Joseph Rushton Wakeling 
wrote:
> I've also written a blog post describing new features and the 
> motivations behind this library:
> http://braingam.es/2014/06/hap-random-a-new-random-number-library-for-d/
>
> I think that hap.random fixes certain fundamental design issues 
> with std.random.  However, this needs to be put to the test "in 
> the wild", so I'd really appreciate it if as many people as 
> possible could try it out with their code, and report on the 
> experience:
>
>    * Does it run faster, slower, etc?
>
>    * Do any undesirable memory allocation issues arise?
>
>    * Is the API (broadly similar but not identical to 
> std.random)
>      pleasant to use?

It definitely looks interesting.  The 64bit MT is definitely 
something I'm after.  I have a particularly strange need with 
PRNGs though.  I need to easily make a bunch of child RNGs based 
off a master RNG.  Nothing cryptographic about it but solely to 
make reasoning about generating random maps and worlds easier.  
That way changing one part of the algorithm (say city placement) 
doesn't affect how the map itself is generated, or vice-versa.  
It sounds like the reference types here would actually make my 
life much easier since I'd need to pass in RNGs into each section 
of the generation and would let me be a bit looser with how 
carefully i have to control access to them which is a good thing.


More information about the Digitalmars-d-announce mailing list