coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating pseudo-random integers


From: Bob Proulx
Subject: Re: Generating pseudo-random integers
Date: Sat, 5 Feb 2011 15:17:33 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

Melikamp The Medley wrote:
> Bob Proulx wrote:
> > People are often writing to the mailing list asking to include their
> > code in coreutils. I believe that is the same impression
> > that everyone else had too.
> 
> I don't believe you can guess what other people are thinking with
> any kind of certainty. Unless you are "Bob" ;)

But I am "Bob". :-)

> Also, you keep implying that I asked to include my code in
> coreutils. I did not.

I already said why I had that impression from you.  The words you used
implied that to me.  I am sorry that I was mistaken about your intent.
I think this is another case of being separated by a common language.

> I was upfront about reusing as much code as possible. I never had to
> work with a codebase this size, so some of my decisions are almost
> certainly stupid. In particular, if linking with the existing tree
> is not a good technical solution and copying and pasting would be
> better, I would like to know that.

The code is available and under a free license and you are welcome to
make use of the code in your project under a compatible license.  That
is one of the beautiful things about free software.

But just the same it isn't designed as a linkable library.  Instead
pushing modules into gnulib would probably be a better way to go.

But actually I would look into using the GNU Scientific Library.  It
includes multiple pseudo random number generators.  It is designed as
a library.  It is actively supported.  Check it out.  It seems like
the perfect fit for what you are wanting.

  http://www.gnu.org/software/gsl/

> > I will avoid commenting on the rest of your message.
> 
> That's fine. I tried to answer all of your questions about why I,
> and possibly others, may want a utility that prints pseudo-random
> integers. I gave several arguments for why awk and perl solutions,
> as good as they are, are deficient compared to the solution in
> coreutils. I made a clear case, I thought, for why I want to extend
> *my* copy of coreutils with a simple interface for printing
> numbers. Since you didn't pose any counter-arguments, I can only
> assume that it was convincing enough.

No.  You have made the same error of making assumptions that I made
earlier.  I avoided commenting in private email that wouldn't have any
peer review on the technical points of your message.  Having such
offline discussion isn't a good way to proceed with getting code
changes on a free software project.  So I avoided commenting upon it.
When there are email messages being send both publicly and privately
it is difficult to keep straight what has been said where.  Better not
to say it twice.  Better to keep the discussion on the mailing list
and then just say it once.  And with that in mind I didn't comment
upon it in the private email.

Also random number generation is a subtle topic filled with traps for
the unwary.  I haven't had time to digest the issues in enough detail
to respond to them.  And actually I might not ever.  I have many
requirements upon my time that compete with you.  The onus for
attacking an already peer reviewed implementation is upon you.  I have
no burden upon me to defend it.  But if you are right then you do the
world a good service to bring it forward.  However I am skeptical.

That is really the critical point in trying to use the existing
implementations in awk or perl since those are already under high
scrutiny.  Random numbers are extremely important.  They are used in
many security critical applications.  An error can introduce a very
difficult to deal with problem.  And famously some very simple
programming errors have already introduced some very nasty problems.

Do you really want to support *forever* such a security critical
application?  It isn't trivial.  And if you don't then is it fair to
ask someone else to commit the time and resources to do so?  I don't
think it is fair.  I think it is better to consolidate the resources
needed into the highest leverage positions possible.  At this point in
time that is awk and perl (and I would be okay in including python and
ruby in the list too).  Therefore if there is a bias in the random
number generation in those programs then it should be reported to them
and addressed there.

Back to your original question...

Look at the GNU Scientific Library.  It seems to me like a perfect
match for what you want to do.

 http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Generation.html

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]