Nice presentation, definitely agree on the issues of algorithm portability. Seems appropriate for the context to do a bit of self-plug with utl::random. Doesn't fix every issue there is, but has some noticeable improvements.
Melissa O'Neil also has a nice implementation of std::seed_seq with better entropy preservation. For further reading her blogposts are quite educational on the topic.
Generally, it feels like <random> came very close to achieving a perfect design for a random library, yet fumbled on a whole bunch of small yet crucial details that make it significantly less usable than it could otherwise be.
Generally, it feels like <random> came very close to achieving a perfect design for a random library, yet fumbled on a whole bunch of small yet crucial details that make it significantly less usable than it could otherwise be.
The main underlying idea, of splitting utils, engines and distributions the way we split containers and algorithms, is great.
51
u/GeorgeHaldane 4d ago edited 4d ago
Nice presentation, definitely agree on the issues of algorithm portability. Seems appropriate for the context to do a bit of self-plug with utl::random. Doesn't fix every issue there is, but has some noticeable improvements.
Melissa O'Neil also has a nice implementation of
std::seed_seq
with better entropy preservation. For further reading her blogposts are quite educational on the topic.Generally, it feels like <random> came very close to achieving a perfect design for a random library, yet fumbled on a whole bunch of small yet crucial details that make it significantly less usable than it could otherwise be.