> At 08:48 PM 10/11/2001 -0400, Ryan O'Neil wrote:
> >I was playing with Parrot and wanted a basic random numbers
> >implementation.  Just in case anyone else wants it too, here are the
> >appropriate diffs and test file.  It seemed logical for rand to return a
> >real number between 0 and 1 instead of having any reliance on
> >RAND_MAX.  Any other ideas?
>
> I'm not 100% sure I want random number generation to be a fundamental part
> of the interpreter. (Though it *is* really appealing...) This sort of thing
> might be better put in the standard library rather than built in as a core
> opcode.
>
> Nifty, though. :)

My take on this follows from Larry's attempt to "Huffman encode" the
language.  What do we use most often, and how efficient should that stuff
be?  It seems that a log-string op-code could be very useful to module
developers; if they can't get system modules to load properly than a
garunteed log op-code would be invaluable.  Alternatively, something like
time and rand are quick-little functions that are very useful in inner
loops.  Profiling and optimized loops would really love to have them.  The
only negative I see is in the compiler complexity (the CISC v.s. RISC
argument).  I don't know how much time a system-library call will take
(meaning this point might be moot if it's fast enough), plus time and rand
are probably good candiates for over-loading which would require
higher-than-op-code status.

Oh well.

-Michael

Reply via email to