RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

forax at univ-mlv.fr forax at univ-mlv.fr
Tue Nov 24 22:27:12 UTC 2020


----- Mail original -----
> De: "Jim Laskey" <james.laskey at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Jim Laskey" <jlaskey at openjdk.java.net>, "build-dev" <build-dev at openjdk.java.net>, "core-libs-dev"
> <core-libs-dev at openjdk.java.net>, "security-dev" <security-dev at openjdk.java.net>
> Envoyé: Lundi 23 Novembre 2020 14:27:31
> Objet: Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

> [Sorry it took so long. Have been on break.]
> 
> From Guy:
> 
> Thanks for the forward.  Here are my thoughts:
> 
> Good question from Rémi.
> 
> If we consider PRNGs to have started at about the time of von Neumann, circa
> 1946, then I would say that we have been inventing a new category about once
> every 25 years or so: jumpable, multi-level jumpable, cryptographically secure,
> splittable.  Twenty years ago we would just have one or more levels of
> jumping/leaping.  I think SecureRandom appeared in 2002 (in J2SE 1.4), and the
> first version of SplittableRandom was in 2014.

I not an expert on PRNG, so i trust you on this.

> 
> So I could be wrong, but I really don’t expect to have to add any more
> interfaces in the next decade or two.  I think we will get more benefit from
> the better type checking than we would get with optional methods.

Again, from my armchair, i see why a SplitableRandomGenerator may make sense (but i'm a big fan of spliterators to my students utter despair), less for the other subtypes of RandomGenerator and as i said to Jim,
i don't see those generators to be taken as parameters of methods a lot so if this assumption is true, optional methods make more sense.

> 
> —Guy

Rémi

> 
> 
>> On Nov 17, 2020, at 7:18 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>> 
>> An honest question,
>> why do we need so many interfaces for the different categories of
>> RandomGenerator ?
>> 
>> My fear is that we are encoding the state of our knowledge of the different
>> kinds of random generators now so it will not be pretty in the future when new
>> categories of random generator are discovered/invented.
>> If we can take example of the past to predict the future, 20 years ago, what
>> should have been the hierarchy at that time.
>> Is it not reasonable to think that we will need new kinds of random generator in
>> the future ?
>> 
>> I wonder if it's not better to have one interface and several optional methods
>> like we have with the collections, it means that we are loosing the
>> possibilities to precisely type a method that only works with a precise type of
>> generator but it will be more future proof.
>> 
>> Rémi
>> 
>> ----- Mail original -----
>>> De: "Jim Laskey" <jlaskey at openjdk.java.net>
>>> À: "build-dev" <build-dev at openjdk.java.net>, "core-libs-dev"
>>> <core-libs-dev at openjdk.java.net>,
>>> security-dev at openjdk.java.net
>>> Envoyé: Mardi 17 Novembre 2020 23:21:18
>>> Objet: Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]
>> 
>>>> This PR is to introduce a new random number API for the JDK. The primary API is
>>>> found in RandomGenerator and RandomGeneratorFactory. Further description can be
>>>> found in the JEP https://openjdk.java.net/jeps/356 .
>>> 
>>> Jim Laskey has updated the pull request with a new target base due to a merge or
>>> a rebase. The pull request now contains 40 commits:
>>> 
>>> - Merge branch 'master' into 8248862
>>> - 8248862: Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  Update package-info.java
>>> - 8248862: Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  Updated RandomGeneratorFactory javadoc.
>>> - 8248862: Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  Updated documentation for RandomGeneratorFactory.
>>> - Merge branch 'master' into 8248862
>>> - Merge branch 'master' into 8248862
>>> - 8248862: Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  Move RandomGeneratorProperty
>>> - Merge branch 'master' into 8248862
>>> - 8248862: Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  Clear up javadoc
>>> - 8248862; Implement Enhanced Pseudo-Random Number Generators
>>> 
>>>  remove RandomGeneratorProperty from API
>>> - ... and 30 more: https://git.openjdk.java.net/jdk/compare/f7517386...6fe94c68
>>> 
>>> -------------
>>> 
>>> Changes: https://git.openjdk.java.net/jdk/pull/1273/files
>>> Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1273&range=02
>>> Stats: 14891 lines in 31 files changed: 11110 ins; 3704 del; 77 mod
>>> Patch: https://git.openjdk.java.net/jdk/pull/1273.diff
>>> Fetch: git fetch https://git.openjdk.java.net/jdk pull/1273/head:pull/1273
>>> 
> >> PR: https://git.openjdk.java.net/jdk/pull/1273


More information about the core-libs-dev mailing list