The thing I haven’t seen yet that makes me raise my eyebrows is sharing one allocation between two data structure. That’s where things get really gnarly with Rust references. The borrow checker is extremely easy to deal with until you start trying to store references in structs, yet the examples I’ve seen with Val don’t show that.
Maybe these cases can be simplified, but I’m very skeptical. It’s a fundamentally difficult problem domain considering that these cases are also very difficult to reason about in C/C++. Questions like: will this request last longer than the current thread?
Unless I got mixed up, from what I remember of previous article it’s because that’s not possible. Val’s references are not first-class, you can’t return or store them.
Maybe these cases can be simplified, but I’m very skeptical. It’s a fundamentally difficult problem domain considering that these cases are also very difficult to reason about in C/C++. Questions like: will this request last longer than the current thread?