5 ms·
Boundary safety is only one of many possible issues. For example, Rust makes it easier to work with arbitrary slices (not copied substrings) while statically ve
by RReverser 8y ago
Boundary safety is only one of many possible issues. For example, Rust makes it easier to work with arbitrary slices (not copied substrings) while statically verifying ownership of the original string.
- htfy96 8y agoWith static analysis most misuse can also be detected: https://godbolt.org/z/UE-Mb0 https://godbolt.org/z/UE-Mb0, which provides more flexibility than Rust even with NLL
- roca 8y agoI'm not aware of any evidence that C++ Lifetimes will detect "most misuse". It will detect some common lifetime errors. It will certainly fail to detect other common lifetime errors. https://robert.ocallahan.org/2018/09/more-realistic-goals-for-c-lifetimes-10.html https://robert.ocallahan.org/2018/09/more-realistic-goals-fo... Since it fails to detect common lifetime errors, it's not surprising it's more "flexible" than Rust NLL, which prevents all lifetime errors.
- htfy96 8y agoThe true negative in the post has been fixed. Rust also doesn't prevent all dangling references as long as you depend on some unsafe third-party library/external library/libc calls and use them in an improper way.
- masklinn 8y ago> which provides more flexibility than Rust even with NLL Not detecting issues being more flexible than detecting issues surprises no one. Raw pointers are also "more flexible" than smart pointers let alone borrow-checked references.