3 ms·
You should just not use Rust. A language should hold strong to its philosophical principles. These kind of changes are fundamentally design by committee.
by voxl 3y ago
You should just not use Rust. A language should hold strong to its philosophical principles. These kind of changes are fundamentally design by committee.
- dmurray 3y agoI agree in principle - what's the point in deciding to use Rust but turning off the borrow checker? But on the other hand - Rust already has unsafe mode, which is exactly for allowing you to avoid some safety checks when you've decided you are smarter than the compiler - this really is an example where the compiler isn't smart enough, as evidenced by the fact there are plans to make it work So another "unsafe" type of marker that watered down the borrow checker would not be totally inconsistent with the language philosophy. It should work at the block or the file level, though - surely you wouldn't want to turn that off for all your code.
- apendleton 3y agoThe whole point of the current `unsafe` mechanism is that you have to explicitly opt one specific chunk of the code out of stricter checking, and it's obvious which chunk of code it is that needs that behavior (the bit inside the block) and which isn't (everything else) -- that bit can be subjected to extra scrutiny upon review, and there's a community-wide shared understanding of what invariants that chunk needs to uphold for the program as a whole to be sound. I'd argue that the alternative mechanism you propose (a compiler flag), which just opts the whole program out of strict checking, _is_ fundamentally philosophically different. Having the opt-in/opt-out mechanism be block-level is a language-design/philosophical decision.
- dmurray 3y agoRight, I didn't propose a compiler-level flag (though the original suggester did), I specifically said it needs to work at the block or file level.