News for hackers. Stuff that matters.
Re:Rust 2024 the Year of Everywhere? by verdagon on Thursday September 22, 2022 @11:31PM (#32947698)
Good news! Complexity isn't a baseline requirement: it's possible to make a language that has the basic patterns and benefits of an average Rust program. It's what we're doing in Vale [0].

It turns out, they key is to move some checks to run-time [1] to reduce complexity, move other checks instead to compile-time [2] where it doesn't increase complexity, and then make the borrow checker "opt-in" instead of forcing it to be used everywhere [3].

[0] https://vale.dev/

[1] https://verdagon.dev/blog/generational-references

[2] https://verdagon.dev/blog/higher-raii-7drl

[3] https://verdagon.dev/blog/zero-cost-refs-regions

Re:Rust 2024 the Year of Everywhere? by cercatrova on Thursday September 22, 2022 @11:47PM (#32947805)
Just curious, why isn't Rust doing this currently? And could Rust adopt something similar to Vale's model?
Re:Rust 2024 the Year of Everywhere? by gouda-gouda on Friday September 23, 2022 @12:14AM (#32947982)
Rust definitely has a mixture of runtime and static checks (Rc, RefCell, Arc, etc)
Re:Rust 2024 the Year of Everywhere? by verdagon on Friday September 23, 2022 @09:49AM (#32951931)
Adding generational references needs to be built into the language at a very deep level to work properly, AFAICT.

One can almost do it by using "side tables" but it would come at a rather high performance cost for Rust. Since generations are located inside / next to the object in Vale, we can take advantage of the cache to avoid any significant slowdowns.

Additionally, one of the main benefits of this approach is simplicity for the user, and I'm not sure Rust can be made simpler by adding more mechanisms.