3 ms·
> there are many safe programs that the compiler rejects It's often less about being safe currently and more about being resilient to breaking after further c
by Manishearth 11y ago
> there are many safe programs that the compiler rejects
It's often less about being safe currently and more about being resilient to breaking after further changes in code. I've worked with some C++ codebases that rely on complicated invariants to be safe (so the code looks safe now), and stuff breaks down when certain changes are made. Programming with a C++11 style greatly reduces but does not eliminate this.
It takes a while to get a hang of this, but once you figure out the "Rust way" of moving data/references around you tend to hit these errors very rarely. Of course, this takes time to learn which you may not have :)
But yes, there are things which Rust could improve upon here, like nonlexical scopes and SEME regions. Which may come soon.