has anyone tried using reinforcement machine learning to make borrow checker errors go away? effectively a brute-force solution to borrow checker errors?
we could kinda use one right now...
has anyone tried using reinforcement machine learning to make borrow checker errors go away? effectively a brute-force solution to borrow checker errors?
we could kinda use one right now...
You'd better hope the ML doesn't learn to just use unsafe
pointers everywhere... sometimes that is the right solution, but with careful consideration to uphold safety around it.
Those don't really use real-time compiler feedback. They're not well suited to finding the optimal solution to a given particular borrowck issue.
Nah the code with the borrowck issues already uses unsafe
everywhere. It'd be nice if the ML used more unsafe
. Maybe then it'd actually work.
In the vast majority of cases, it would seem to work and then break unexpectedly - maybe even without anyone noticing.
That's what miri with raw pointer tagging is for, ofc!
Would it not be that at that rate you're just writing C and shoving it through an address sanitizer?
Nah because the result of all this is a safe Rust API anyone can use without having to think about the internals.
Well, it will catch the problem only if it is hit by the code path in use. Do you have the 100% code coverage, at least? (And note that this is not enough, since some code path might hit the UB case only with particular inputs)
Yes, the tests should cover all the ways the API user can misuse lifetime variance. Code coverage no longer matters at that point, as it's just transmutes and callbacks.