5 ms·
The Drama between the author of PCG (u/ProfONeill) and the author of xoshiro (u/sebastianovigna) is one of the more entertanining parts of the C++ community. To
by s9w 6y ago
The Drama between the author of PCG (u/ProfONeill) and the author of xoshiro (u/sebastianovigna) is one of the more entertanining parts of the C++ community. Too bad that despite that fierce competition, the <random> standard header itself is universally hated.
- littlestymaar 6y agoentertaining isn't really the word I'd use…
- OskarS 6y ago<random> and <chrono> have really been in a death match of "C++ standard libraries that are super-annoyingly C++", but they've both been absolutely destroyed by <range>, i think.
- s9w 6y agoAs in range being better or even worse? I haven't tried it out yet.
- OskarS 6y agoFrom what little I've used it, <range> is a C++ nightmare. Compile times explode and every time you get a tiny type error (which is impossible avoid, because the library is very persnickety about types) you get a bazillion pages of template errors. Concepts and modules (supposedly) fix these issues, and I'm not going to use ranges again until those two are very mature features of C++. Even if you ignore this stuff, it's incredibly "C++ified" in just the worst way, with incredibly obtuse templates and type concepts all over the place.
- steerablesafe 6y agoI agree regarding <random>, but <chrono> is a work of art.
- s9w 6y agoI like <chrono>. But I recently used the not quite yet standard "date" library. And that is super confusing in combination with <chrono>. You end up having an overlap of some functions and classes, some of which are in the date namespace, some of which are in chrono/std. And functions don't even properly error on compile when you do things wrong, but quietly misbehave. I hope this will solve itself once both arrive in compilers and both are in std:: namespace.
- OskarS 6y agoI don't know man, if I have to do another std::chrono::duration_cast, i might chuck my computer out of a window.
- bertr4nd 6y agoWe’re so far off topic, but I agree with you SO much. <chrono> completely resists my attempts to remember how to do anything with it, no matter how many times I have needed to do something trivial like “time this region of code.”
- GoblinSlayer 6y agoThis cppunk design aims to provide building blocks for you to build your own solution instead of some ready solution out of fear that they might misdesign something, that's why it's so heavily customizable. So yeah, you're supposed to roll a layer on top of it and build a component with reasonable functionality for this day or for your case.
- brandmeyer 6y agoI love <random>. Really. Sure, some other languages make the simple cases a little simpler, but no other system offers up the flexibility and control that <random> does. Lets take PCG's author's comments one by one: https://www.pcg-random.org/posts/cpp-seeding-surprises.html https://www.pcg-random.org/posts/cpp-seeding-surprises.html Re: Predictability. I don't care. Truely. If unpredicatablity is important, the application must use a cryptographic random number generator. Those are the only known family that are hard-to-predict. Valuing un-predictabiltiy from a non-cryptographic PRNG has always been one of PCG's demerits in the xoshiro-versus-pcg debacle. Re: Seed_seq's problems. The biases she's making out to be catastrophic are really quite small. In actual scientific monte carlo simulations, they don't affect things at all. I want to know the difference between 10^6 floats generated from the gaussian distribution, one with seed-seq's optimally seeded and one with it sub-optimally seeded. Because the "motivating scenario" isn't. You shouldn't ever be using a PRNG if all you need is one random number. You just grab a seed from a strongly-random generator like /dev/random. The argument about seed_seq failing to be a bijection is completely irrelevant. You just need it to uniquely select one internal state of MT from the one initial value. So long each sequence of the first 600-someodd values drawn from it are unique, you've done that. The demonstrated bias in MT's initial conditions doesn't matter one whit.
- s9w 6y agoI think one of the main criticisms of <random> is that the distrubutions are implementation-defined. That means you get different outputs based on your compiler, even if your seed and even the rng itself is the same.
- brandmeyer 6y agoFor better and for worse, this is a part of the standard where the committee deliberately under-specified things to allow room for improvement.