3 ms·
>> I can imagine a future in which AI analyses C++ and makes it memory safe. Equivalent algorithms are built into the Rust compiler. Tracking the lifetime of
by thesuperbigfrog 4y ago
>> I can imagine a future in which AI analyses C++ and makes it memory safe.
Equivalent algorithms are built into the Rust compiler.
Tracking the lifetime of a variable and ensuring that the underlying resources are properly managed does not require artificial intelligence, just good bookkeeping.
- brundolf 4y agoThere are memory-safe programs that the borrow checker will not let you write because of its limitations (and this will always be true, no matter how smart it gets, and is true of any static type system or checker). This is a conscious tradeoff you make by using the language. It's also why unsafe blocks exist- not so you can intentionally make memory errors, but so you can attempt to safely work around the borrow-checker's limitations
- thesuperbigfrog 4y ago>> This is a conscious tradeoff you make using the language, and it's also why unsafe blocks exist Agreed. Unsafe Rust is needed to handle specific use cases. However, unchecked / unsafe blocks are not needed most of the time and should be used sparingly and judiciously.