logoalt Hacker News

Animats • today at 9:49 PM • 1 reply • view on HN

> But group borrowing actually resolves the conflict, by relaxing "shared-xor-mutable" to "no use-after-free".

That's the one line that defines what's going on here.

If all you want is "no use after free", either reference counts or garbage collection will do the job. That's how most GC-oriented languages work.

Rust enforces stricter rules - single ownership, one writer or N readers. The question is whether that's worth the trouble. In threaded programs, it definitely is, because it prevents race conditions. Whether it's a win for single-thread programs is a good question.

Vale seems to be a way to move much of the overhead of a reference-counted system at compile time. Nothing wrong with that. The main motivation seems to be better interoperability with less restrictive languages. Am I reading that correctly?


Replies

gpm • today at 10:12 PM

I don't think you're reading it correctly.

I'd describe this as approximately weakening aliasing xor mutability to interior-aliasing xor mutability. The motivation seeming to be to have a more expressive system that rejects fewer correct programs. With a secondary goal of interacting with more (not less) restrictive languages (namely rust).