-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
assignedTopic has been assignedTopic has been assignedin-contentIs the issue in lesson content?Is the issue in lesson content?
Milestone
Description
We already have an implementation of PCG pseudorandom number generation in roc-random but implementing random generators in a purely functional language seems like a good fit for this book because:
- Most languages have something like a
random()function which isn't pure (since it potentially returns a different answer each time it's called). Because of this, it's a common beginner surprise to discover that a random number generator in a pure FP language has to present a different API. - There are a bunch of different PRNG algorithms out there, including ones that are simple enough that you can write the "randomness" part in a few lines of code, and then focus on the concept of how computers do "randomness" and pure FP API differences (including generating things other than numbers) for the rest of the chapter - which are the more interesting parts.
- There's a good opportunity for some "further reading" notes on why algorithms like PCG and xoroshiro provide better distributions of outputs, performance tradeoffs, entropy sources for secure randomness, etc.
Anton-4
Metadata
Metadata
Assignees
Labels
assignedTopic has been assignedTopic has been assignedin-contentIs the issue in lesson content?Is the issue in lesson content?