News for hackers. Stuff that matters.
Re:Forget Borrow Checkers: C3 Solved Memory Lifetimes with S... by lerno on Monday July 14, 2025 @09:27AM (#44559981)
You lost me there I'm afraid.
Re:Forget Borrow Checkers: C3 Solved Memory Lifetimes with S... by ameliaquining on Monday July 14, 2025 @01:26PM (#44562824)
The idea is, you could have a language like Rust, but with linear rather than affine types. Such a language would have RAII-like idioms, but no implicit destructors; instead, it'd be a compile-time error to have a non-Copy local variable whose value is not always moved out of it before its scope ends (i.e., to write code that in Rust could include an implicit destructor call). So you would have explicit deallocation functions like in C, but unlike in C you could not have resource leaks from forgetting to call them, because the compiler would not let you.

To the extent that you subscribe to a principle like "invisible function calls are never okay", this solves that without undermining Rust's safety story more broadly. I have no idea whether proponents of "better C" type languages have this as their core rationale; I personally don't see the appeal of that flavor of language design.

Re:Forget Borrow Checkers: C3 Solved Memory Lifetimes with S... by bmacho on Friday July 18, 2025 @05:28AM (#44602746)
Verdagon has this linear types/higher-RAII article: https://verdagon.dev/blog/higher-raii-7drl

It is about types that can't be copied and can't go out of scope, and the only way to destroy them is to call one of their destructors. This is compile time checkable.

In theory they can solve a lot of problems easily, mainly resource management. Also it generalizes C++'s RAII, and similar to Rust's ownership.

In practice they haven't got support in any mainstream programming language yet.