Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: consider using math/rand/v2 when available #1906

Open
sbinet opened this issue Oct 3, 2023 · 5 comments
Open

all: consider using math/rand/v2 when available #1906

sbinet opened this issue Oct 3, 2023 · 5 comments

Comments

@sbinet
Copy link
Member

sbinet commented Oct 3, 2023

as golang/go#61716 is now accepted, we should probably migrate to using math/rand/v2, when all the Go versions we support ship it.
(and drop the use of x/exp/rand)

@kortschak
Copy link
Member

I was thinking the same thing.

@Juneezee
Copy link
Contributor

Go 1.23 is released https://go.dev/blog/go1.23

We can start working on this after we bump our minimum supported version to Go 1.22 1.

Footnotes

  1. https://go.dev/doc/go1.22#math_rand_v2

@kortschak
Copy link
Member

I have already started work on this (against 1.23r1). The changes are not trivial.

@kortschak
Copy link
Member

The complexities arise from differences in sequencing between exp/rand and rand/v2. There are also API differences which complicate things. I forked out a copy of rand/v2 into an internal package to shim over the API differences with the aim to progressively repair the change. Due to the sequence differences, some tests will no longer pass (catastrophically in some cases).

I may send the branch as I have it at the moment, but I don't have time to work on it for the next few weeks.

@kortschak
Copy link
Member

Change as it exists, is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants