Random number generation #5

Open
opened 2025-12-13 17:26:43 -05:00 by Ghost · 3 comments
Ghost commented 2025-12-13 17:26:43 -05:00 (Migrated from codefloe.com)

Use algorithms like PCG for random number generation. By the time this gets implemented, there may be even better algorithms for fast random number generation. Implement those too, and make whichever one is the best the default implementation.

References:

Use algorithms like PCG for random number generation. By the time this gets implemented, there may be even better algorithms for fast random number generation. Implement those too, and make whichever one is the best the default implementation. References: - https://go.dev/blog/randv2 - https://www.pcg-random.org
Ghost commented 2025-12-15 12:40:19 -05:00 (Migrated from codefloe.com)

Done via std/crypto/rand and std/uuid (which uses std/crypt/rand). Implements std.crypto.rand.entropy, along-side pcg.

Done via std/crypto/rand and std/uuid (which uses std/crypt/rand). Implements std.crypto.rand.entropy, along-side pcg.
Ghost commented 2025-12-15 12:54:48 -05:00 (Migrated from codefloe.com)

I'm gonna leave this open for now, but I think we can start documenting the standard library since you've begun implementing it. This issue can be closed when the documentation for the implemented RNGs has been written.

Maybe std/uuid should be std/crypto/uuid, since I think it makes sense to put all the cryptography-related stuff together?

The reason this was a separate issue was because I assumed the normal random number generation would be separate from the CSPRNG, but if you've implemented both with one algorithm, then that now links #6 to this as well.

I'm gonna leave this open for now, but I think we can start documenting the standard library since you've begun implementing it. This issue can be closed when the documentation for the implemented RNGs has been written. Maybe `std/uuid` should be `std/crypto/uuid`, since I think it makes sense to put all the cryptography-related stuff together? The reason this was a separate issue was because I assumed the normal random number generation would be separate from the CSPRNG, but if you've implemented both with one algorithm, then that now links #6 to this as well.
Ghost commented 2025-12-15 13:16:53 -05:00 (Migrated from codefloe.com)

std/crypto should be specific to cryptological stuff, ie, encrypt, decrypt, entropy, etc. std/uuid just uses it as a dep, so I don't think it makes sense to put it there

std/crypto should be specific to cryptological stuff, ie, encrypt, decrypt, entropy, etc. std/uuid just uses it as a dep, so I don't think it makes sense to put it there
Sign in to join this conversation.
No labels
stdlib
syntax
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nclang/design#5
No description provided.