←back to thread

177 points signa11 | 2 comments | | HN request time: 0.424s | source
Show context
Ygg2 ◴[] No.42161017[source]
> This means that in order to write C++, you effectively have to memorize the undefined behavior rules, which sucks.

> This means, to be a highly productive Rust programmer, you basically have to memorize the borrow checker rules, so you get it right the first time. This is stupid, because the whole point of having a type system or a borrow checker is to tell you when you get it wrong

I'm not sure how you want to square this circle, you don't want to memorize the rules of UB, but you also don't want for compiler to correct you when you make UB behavior according to Borrow Checker?

The best way in both C++ and Rust is to structure your tree of lifetimes and use other means to achieve your desired goal.

replies(1): >>42161219 #
1. recursivecaveat ◴[] No.42161219[source]
They just don't want the borrow checker errors to only come after type checking. You have to know the rules well because otherwise you're going to finish a big refactor only to find out afterwards it was never going to work.
replies(1): >>42163261 #
2. Ygg2 ◴[] No.42163261[source]
That's one of their issues. Other issues are borrow virality and stuff for next Rust.