Re: Not magical thinking
From a Security view, i.e. a measurable outcome, I want diverse compilation, as it's the sole defence against trusting trust; so switching to a single source compiler for a "security focus" would represent a degrading of the security posture.
From a Productivity view, i.e. fuzzy feels; Rust is neither expressive enough to get out of the way, I dislike the syntax and the borrow checker adds not much to UBSan/ASan/Valgrind and testing for which bit for bit reproducible builds aid greatly How do you define safety?
Hardware is not irreverent - that's the root of the disagreement.
I want something to bit twiddle some settings or use a bit-field in a struct to meet the requirements of the problem - not to convince some bit of software that doing so is "safe" according to the "borrow checker".
Sometimes I want exactly these instructions emitted and the entire rest of the program is just scaffold to feed that loop. There's plenty of safe expressive pythonic code to express that in more C programmer friendly terms in C++, but Rust adds ? it's based on insulting professionals, who's code has millennia of hours in operation.
C++ and C get out of your way, trusting you to know what you're doing.
Rust suggests, that if the borrow checks shuts up, your perfectly constructed ode to category theory is safe. Notice "safe" not "correct", nor reasonably easy to map the running instructions back to the source code statements that generated them.
In C++ it's a little bit of a chore because of name mangling but otherwise tractable. In C it's much the same sans mangling. In Rust, please. It's a completely unsuitable problem domain for system programming or anything close to the hardware.
It's Golang for functional programmers who like curly braces - of interest to everybody other than C and C++ programmers - who already have far better tools at their disposal.
Have you seen Chrono ?
#include <chrono>
int main() {
using namespace std::chrono;
// Add durations together
duration Duration { weeks(2) + days(4) };
// Increase an existing duration
Duration += days(2);
// Doubling an existing duration
Duration *= 2;
}
What am I getting from Rust?