Post AwPd2xNNfGOAeTIFnc by mcc@mastodon.social
 (DIR) More posts by mcc@mastodon.social
 (DIR) Post #AwPXzR20xtZvhHnipE by mcc@mastodon.social
       2025-07-23T01:24:50Z
       
       1 likes, 0 repeats
       
       A thing that constantly blows my mind about writing Rust is how handling error conditions feels *horrible*, it's miserable and it's a constant source of friction, but then I think about how I would have written the equivalent C++ and I basically would have like… just… not… handled errors correctly, probably
       
 (DIR) Post #AwPd2p6mP6M90fSsoS by lambdageek@mastodon.social
       2025-07-23T02:11:15Z
       
       0 likes, 0 repeats
       
       @mcc I'm mostly fine with rust error handling when it's just this error and .into()? all over the place, but then I'm forced to interact with some Option<Result<T>> async monstrosity or handle an io::Error and I just...
       
 (DIR) Post #AwPd2r2FEvuuzBMI1Q by lambdageek@mastodon.social
       2025-07-23T02:25:15Z
       
       0 likes, 0 repeats
       
       @mcc oh I thought of another thing that is unpleasant: impl Iterator<Item = Box<dyn Error> > is like never good enough when I want to walk a chain of errors.
       
 (DIR) Post #AwPd2sh34i9O81SOGG by mcc@mastodon.social
       2025-07-23T02:30:33Z
       
       0 likes, 0 repeats
       
       @lambdageek *thinks* hrm. well, i've never used dyn error. maybe that's part of why i don't mind the system so much.my current project is going to get a lot uglier as soon as an error starts containing more information than a human-readable string.
       
 (DIR) Post #AwPd2uP2icw5Ql32TQ by lambdageek@mastodon.social
       2025-07-23T02:35:42Z
       
       0 likes, 0 repeats
       
       @mcc yeah this comes up when you have some extra trait that all of your own errors implement and you want to walk through a chain of causes and do your special trait things and the std Error trait only gives you an impl Error not an impl Error + YourTrait miette (and I think anyhow) end up basically making their own traits have a whole duplicated traversal thing for this exact reason.I don't have a solution, but the status quo is sad
       
 (DIR) Post #AwPd2vpJQRXjqWLX3g by mcc@mastodon.social
       2025-07-23T02:48:25Z
       
       0 likes, 0 repeats
       
       @lambdageek It seems like at some point Rust should notice that the advice for how to write a large program in Rust is "use miette or anyhow" and realize they should incorporate something like miette into the language
       
 (DIR) Post #AwPd2wRF9PstkA5pBI by lambdageek@mastodon.social
       2025-07-23T02:58:02Z
       
       0 likes, 0 repeats
       
       @mcc I didn't mean to imply that miette solves my particular problem (walk a chain of types that implement Error/Diagnostic and do some special other trait to them).I think std should do two things: 1. Provide building blocks for other crates to build frameworks2. Provide a lingua franca so that creates that use different frameworks can still interoperate. Things like async feel like they strike this balance much more deliberately. Whereas the std Error trait feels more haphazard
       
 (DIR) Post #AwPd2xNNfGOAeTIFnc by mcc@mastodon.social
       2025-07-23T03:29:25Z
       
       0 likes, 0 repeats
       
       @lambdageek Is there a difference in the type system that could be implemented , which would allow you to get your "Error + trait" behavior you want in the situation you're describing?