rand()
in stdlib
#646
Replies: 2 comments 1 reply
-
We should only support It's really important that we have deterministic scripts in part because we want to query both the ast and the program memory after an initial execution, and having things be consistent between executions is important. It's possible that we could support a true rand with the above, but it would add a lot of complexity that I simply don't think is worth it for us now, so I think if we hand rand it has to be with a seed, and that goes for any other non-deterministic behaviour. I have a strong conviction on this. I might be wrong on this but I see the use of rand() to be mostly a creative util, doesn't have much use for mechanical design (tell me if I'm wrong) an exception might be noise for a surface, but that doesn't need to be different for each execution, so rand with seed still stands. If users really want to output multiple parts that vary because of a random value, they can implement it themselves by looping in bash with the cli and inputting env-vars (not that we support env-vars yet). That way when using the app to develop scripts in our sandbox of an app, everything is deterministic, and users can inject their own random values outside of the app. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
random integer etc
https://discord.com/channels/915388055236509727/1153710304656633976/1153794842015584326
Beta Was this translation helpful? Give feedback.
All reactions