@khinsen Won't lie- I was low-key annoyed yesterday when my desire to generate a random number in Rust brought something like 17 dependencies into my project. WTF?!?
@khinsen Actually, "annoyed" isn't the proper word. It's more like "embarrassed." I'm embarrassed for myself for having to resort to using such a dependency. I'm also embarrassed for the devs of that package. I get it. Random numbers are trickier than they look. I've been around a long time and know about that. But 17 dependencies? To do what?!? Come on.
@dabeaz Would a C version be acceptable in your Rust project? There are high-quality single-C-file random number generators at
@khinsen Sure, but why can't there be a nice single-file Rust version? (Maybe there is, but I need to search harder).
This looks like a nice blog post about it. Apparently you can turn off default features of rand to shrink it down a lot already, didn't know that:
@khleedril @faassen @khinsen Agree. I'm not sure I'd follow much of anything from that blog post except to look a bit further into the `fastrand` crate. Maybe I'd call out to drand48 in C.