> "This is the first time we had to make sure the game is deterministic between ARM and x86. We should be fine, C++ is portable, right? Just don't use undefined behavior. Turns out we use quite a lot of undefined behavior..."
Hah
Hah
Things as simple as "believing you know the byte-width of a primitive data type" are dangerous.
In my C++ course, I require that the code runs correctly under 5 different compilers (GCC, LLVM Clang, Apple Clang, MSVC, Intel C++ Compiler Classic) on 3 OS (Ubuntu, Windows, macOS) in Release, Debug+Valgrind, Debug+Sanitizers modes, and students still get UB quite often.
Extra reading: http://evan.nemerson.com/2021/05/04/portability-is-reliabili... and discussion at https://news.ycombinator.com/item?id=27044419
Many of us write C and C++, because we have to, not because we want to.
Rust will eventually reach there, however many of us want to deliver a product, not build an ecosystem from scratch.