3 ms·
You're right every monad requires its own ad hoc operators in Rust but Error is already "blessed" with the try! macro. I think the irony is that he traded an Er
by imtringued 6y ago
You're right every monad requires its own ad hoc operators in Rust but Error is already "blessed" with the try! macro. I think the irony is that he traded an Error result for an Error-less "Handle" object which required him to write his own macros. The intention to make things better made things much worse.
However, API usability itself is not the problem. Although it was just a small portion of the blog: "Custom Wayland protocols aren’t possible" actually showed the real roadblock. It means wlroots-rs has no reason to exist.
- lmm 6y ago> I think the irony is that he traded an Error result for an Error-less "Handle" object which required him to write his own macros. I don't think he could've used Error, because he needed that custom Handle type to have the right ownership/lifecycle behaviour. > Although it was just a small portion of the blog: "Custom Wayland protocols aren’t possible" actually showed the real roadblock. It means wlroots-rs has no reason to exist. But the big concern there is the same problem: an inability to make an API that can be used safely (without massive amounts of custom engineering).
- quotemstr 6y agoA weak pointer approach would have been perfectly acceptable IMHO --- branch predictors being very good and most wlroots calls being low frequency. It seems to me that the author of this library went to tremendous technical trouble and ultimately failed largely because he prematurely optimized.