Bluefinger / bevy_turborand

A plugin to enable random number generation for the Bevy game engine.
Apache License 2.0
36 stars 6 forks source link

Expose actual docs instead of "Delegated .... from ..." in delegate_rng_trait macro. #16

Open laundmo opened 6 months ago

laundmo commented 6 months ago

"Delegated ... from ..." does not tell me anything. It requires me to open the docs of turborand in the browser just to see what a simple method is doing.

This is bad UX.

Bluefinger commented 6 months ago

Frankly, the entire Delegated thing is bad DX, but one that arises from the mismatch of turborand being mostly &self methods and ECS access patterns for threadsafety and determinism favouring &mut self methods, given that on its own, turborand is not threadsafe.

Likewise, it has required doing the repetitious macros to get around this, but I have yet to figure out how to re-export the doc comments from the original type/method to the delegated one. Otherwise, I'd have to copy-paste manually all of the docs from one crate to the other, or go write some proc macros which I'm not really motivated to learn for this crate alone.

Stuff like this is why I wrote bevy_rand, which is just the better API. Just use the wyrand feature if you need the same PRNG algorithm as what turborand is using.

In the mean time, I'll go poking around and see what I can do, but I wouldn't be too hopeful :sweat_smile: