8000 API: Random · Issue #91 · luau-lang/lute · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

API: Random #91

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

Open
aatxe opened this issue Feb 26, 2025 · 3 comments
Open

API: Random #91

aatxe opened this issue Feb 26, 2025 · 3 comments
Labels
bikeshed Debat 8000 ing the best name or API for something. enhancement New feature or request runtime Work in the C++ runtime portion of the code std Work in the Luau standard library portion of the code

Comments

@aatxe
Copy link
Collaborator
aatxe commented Feb 26, 2025

Lute should consider including a random API that is more featureful than just math.random. Might be reasonable to just wrap math.random or might be reasonable to introduce a Lute-specific random primitive. Not entirely sure whether this belongs in batteries or std.

@aatxe aatxe added bikeshed Debating the best name or API for something. enhancement New feature or request labels Feb 26, 2025
@aatxe aatxe changed the title A more full-fledged random API. API: Random Feb 26, 2025
@aatxe aatxe added the std Work in the Luau standard library portion of the code label Mar 19, 2025
@aatxe
Copy link
Collaborator Author
aatxe commented Mar 19, 2025

I think I'm inclined to say std is a better home for this for now in that I expect it will likely want a bit more random stuff exposes from the runtime as well to support it.

@aatxe aatxe added the runtime Work in the C++ runtime portion of the code label Mar 19, 2025
@ffrostfall
Copy link
Contributor

I think I'm inclined to say std is a better home for this for now in that I expect it will likely want a bit more random stuff exposes from the runtime as well to support it.

I think that batteries would be a better place for this. There's so many incredibly useful (yet opinionated/impl specific) aspects about randomization that I think it makes more sense as a "psuedo-package" (so, a battery).

Random unit vector, weighted unit vector, random vector in a box, vector with random elements on specific axes, random vector within a circle, etc. etc.

However I think we should expose a better source of randomization than what Luau provides by default, as a runtime. Maybe this could be includ 7D95 ed in the system library?

@aatxe
Copy link
Collaborator Author
aatxe commented Apr 21, 2025

Exposing better stuff in the runtime is a lot of what this intended, not necessarily super general purpose high level random stuff. The remaining bits would just be "an API that lets you select from different CRNGs probably"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bikeshed Debating the best name or API for something. enhancement New feature or request runtime Work in the C++ runtime portion of the code std Work in the Luau standard library portion of the code
Development

No branches or pull requests

2 participants
0