Request for code review: nolife 0.3.1
github.com/dureuill/nolifePosted Dec 28, 2023, 8:36 AM UTC
Posted Dec 28, 2023, 8:36 AM UTC
Before yoke there were several crates that all tried to solve this problem and were all found to be unsound sooner or later. It's possible that day is still coming for yoke, though I certainly hope not.
As you note about miri and unsoundness bugs, the real problem is that miri can only test API interactions you actually wrote tests for, it can't prove that no such interactions are possible. Putting the crate out there for people to start testing is a necessary and worthwhile step, but there's a chicken-egg problem where users would be justifiably reluctant to try it until other users have spent years beseiging the API against potential unsoundness.
I guess the main question to answer would be: why should a user prefer to use this over yoke? The implementation may be very clever but for users to wade into the potential UB swamp they need to at least have an upside to work toward.
Well I made an announcement of the crate via a blog post. Hopefully there I articulate better what the value proposition is over yoke
https://www.reddit.com/r/rust/comments/193ip8n/say_goodbye_to_lifetime_errors_announcing_nolife/
Hello!
I have been working on `nolife` for the longest time š . It is an alternative to [yoke](https://lib.rs/crates/yoke) that leverages async functions to freeze a scope that contains borrow and store it without a lifetime (hence, `nolife`).
It is very useful whenever you're using a costly to build reference to some data, but you don't want or cannot store the lifetime in the parent struct (e.g. because it would make the parent struct autoreferential).
However, it uses quite a bit of unsafe, and while there are tests that pass miri, this does not prove the absence of soundness bugs.
ā
That's why I'm kindly requesting if some of you could perform a review of the code to check for soundness and safety (cannot trigger unsoundness from user code without using unsafe) š