-
Notifications
You must be signed in to change notification settings - Fork 372
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
Port math/rand to gno #1272
Comments
there is a working implementation of the I'm pasting the relevant code for review here (you can ignore it, use it as a starting point in your own approach, or even ask me to do a PR, if you think it will cut it, for now). this is located in line 394 onward:
|
This PR ports over to Gno the [math/rand/v2](https://pkg.go.dev/math/rand/v2) Go package. It provides pseudo-random number generation. Notable omissions: - the [`N` generic function](https://pkg.go.dev/math/rand/[email protected]#N) - The [chacha8 random source](https://pkg.go.dev/math/rand/[email protected]#ChaCha8) (we can use PCG instead; and chacha8 can be implemented later) This PR requires a version bump to go 1.22 to have math/rand/v2 in the standard libraries; otherwise the Native tests won't work. We can rollback the changes to move it to 1.22 by removing the native math/rand implementation, and only using the stdlibs. BREAKING CHANGE: existing usages of math/rand used Go's math/rand; however, in this new standard library we use its v2, so results will be different. Closes #1272; See-also #1267 <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
This PR ports over to Gno the [math/rand/v2](https://pkg.go.dev/math/rand/v2) Go package. It provides pseudo-random number generation. Notable omissions: - the [`N` generic function](https://pkg.go.dev/math/rand/[email protected]#N) - The [chacha8 random source](https://pkg.go.dev/math/rand/[email protected]#ChaCha8) (we can use PCG instead; and chacha8 can be implemented later) This PR requires a version bump to go 1.22 to have math/rand/v2 in the standard libraries; otherwise the Native tests won't work. We can rollback the changes to move it to 1.22 by removing the native math/rand implementation, and only using the stdlibs. BREAKING CHANGE: existing usages of math/rand used Go's math/rand; however, in this new standard library we use its v2, so results will be different. Closes gnolang#1272; See-also gnolang#1267 <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Description
Following the steps described here.
The text was updated successfully, but these errors were encountered: