Hacker News new | ask | show | jobs
by gmfawcett 3911 days ago
"RAII" seems to cover it nicely, and extends beyond memory management to other resources. Admittedly it's not a very friendly term for non-C++ programmers.

What's this non-lexical borrowing idea you mentioned in your other comment? (I can't reply there for some reason.) Is there an RFC for that?

2 comments

The relevant search terms are "SEME regions" and "non-lexical borrows". The tracking issue is here: https://github.com/rust-lang/rfcs/issues/811 and https://github.com/rust-lang/rust/issues/6393 is the older issue it superseded, with examples.

There hasn't been an RFC yet, because we're in the middle of a large amount of compiler internals work (HIR/MIR), which will make overall analysis easier, including these two features.

> (I can't reply there for some reason.)

HN limits responses based on the depth of the comment tree and the length of time since the comment was posted, to discourage flamewars, you can always click on a comment link directly to kind of bypass that though.

Thanks for the issue link (and for the comment-tree depth hint!).
Scope-bound resource management (SBRM) is clearer than RAII, I think.