Ticket #189 (closed todo: done)

Opened 6 years ago

Last modified 5 years ago

deprecated: random PMC

Reported by: coke Owned by:
Priority: normal Milestone:
Component: none Version:
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description (last modified by coke) (diff)

Random PMC should be deleted - usage of random should be replaced by a rand dynop (see TT #871)

Change History

Changed 6 years ago by kjs

  • platform set to all
  • type changed from bug to todo

Changed 6 years ago by coke

  • owner set to allison

runtime/parrot/library/Math/Random/mt19937ar.pir doesn't appear to actually be random, just psuedorandom.

We have some internal C level functions for randomness in src/utils.c.

I think we need an architectural decision as to how we want to get our random on.

Some options: - Keep the singleton Random (no change, reject ticket) - non-singleton Random - opcode wrapping the C functions. - PIR library (probably wrapping the C functions). - method (class or instance) on (e.g.) the Float PMC.

Let's actually decide what we want before ripping out the Random PMC.

I vote we delay removal of this PMC until after 1.0

Changed 6 years ago by coke

Here's a nicely formatted list of options, since I can't change what I just commented:

  • Keep the singleton Random (no change, reject ticket)
  • non-singleton Random
  • opcode wrapping the C functions.
  • PIR library (probably wrapping the C functions).
  • method (class or instance) on (e.g.) the Float PMC.

Changed 6 years ago by fperrad

Random PMC is a wrapper over C rand48 funtions (pseudo-random generator).

These functions could be rewrite in PIR, like mt19997 (Mersenne Twisted) were.

mt19997 and rand48 have not the same properties. See  http://en.wikipedia.org/wiki/Mersenne_twister .

Parrot could have many different pseudo-random generator libraries (written in PIR).

But Parrot needs a portable entropy source, because /dev/rnd is only available on *nix.

Perl5 Doc gives as advice : srand (time $$ unpack "%L*", ps axww | gzip -f);

Parrot could do better (and simpler).

Changed 6 years ago by coke

There are bugs reported against the new Math/Rand library; (TT #392) - it would be nice if we could get a ruling on how we want to expose our entropy before spending cycles fixing things.

Changed 5 years ago by allison

  • milestone changed from 1.0 to 1.1

Add 'rand' as a dynop (possibly with several variations of randomness).

And agreed on moving to post-1.0.

Allison

Changed 5 years ago by allison

  • owner allison deleted
  • milestone 1.1 deleted

Changed 5 years ago by coke

This ticket depends on TT #871. (trac-- no ticket deps)

Changed 5 years ago by coke

  • description modified (diff)

Changed 5 years ago by bacek

  • status changed from new to closed
  • resolution set to done

rand dynop was added, Random PMC removed. Closing ticket.

Note: See TracTickets for help on using tickets.