To all the "why bother" rustaceans
To all the "why bother" rustaceans
Posted Dec 9, 2022 9:29 UTC (Fri) by tialaramex (subscriber, #21167)In reply to: To all the "why bother" rustaceans by mathstuf
Parent article: Rust support coming to GCC
Rust chooses to answer conservatively, Don't Know counts as No. All three borrow checkers, the one in Rust 1.0, the current one with Non-lexical lifetimes, and Polonius, are conservative, but each increases the range of correct Rust programs which successfully compile over the last.
The conservative choice offers safety, which is Rust's priority, at a cost of programmer inconvenience, which can be iteratively improved upon by working on the borrow checker. Thus, I believe Rust can and should specify that the actual rules are (basically) as you describe, but with a clarifying note that since these are semantic rules any compiler must be conservative. Maybe the note can specify that a conforming compiler must at least be able to allow X where X is some sane baseline of borrow simplicity.
Posted Dec 9, 2022 13:11 UTC (Fri)
by amacater (subscriber, #790)
[Link] (1 responses)
Posted Dec 9, 2022 15:26 UTC (Fri)
by tialaramex (subscriber, #21167)
[Link]
Rust's stability promise has a number of limitations, the one crucial here is that you don't get to depend on bugs. So if the borrow checker, no matter which one, was mistakenly allowing an invalid construction, Rust won't keep that working in future versions.
To all the "why bother" rustaceans
To all the "why bother" rustaceans