The reason we don't use a global random number generator is not because we are worried about live code reloading, although there are some reasons why you might care there (eg., you would at a minimum want the global random number state to be in the save/restore block for looped live code editing, so it should not be a static, etc.)
The reason is because the random number generator may be used for different types of things. A global random number generator would be fine if you never _rely_ on the global random number generator to give repeatable results. But since we are planning on having randomly generated worlds, and we want those worlds to potentially be transmittable as a unique key (eg., "world 48A8FGB2"), we need a way of ensuring that each piece of code knows specifically where its entropy is coming from.
For example, suppose the world generation code needs to run on a separate thread, because it takes too long and we don't want to show a "generating world" screen. Well, if it uses a _global_ random number generator, then depending on who else might be grabbing random numbers at the time, it may generate a completely different world on different machines. If instead we ensure that world generation uses its own entropy stream, that doesn't get used for things like per-frame particle effects or whatnot, then we know that we'll always generate the same world from the same seed.
So it tends to be good discipline to always pass the random number generator to your leaf functions, because you never know who might be using those functions, and you want to ensure that when they're used by the world generation code, they use one source, and when they're used by other code, they use a different source. If instead you have a global one that people use sometimes, you are very likely to make a mistake where you forget that some leaf function uses the global entropy stream, and oops, you happen to call something that calls that function, and now your world generation is not repeatable.
SAD PANDA.
- Casey