On the topic of panics, it's idiomatic to panic in both of these situations today, and the behavior ends up pretty identical to an unchecked, uncaught exception in languages with exceptions.
For hardware error/failure, if it's something we're communicating with, I'd argue some nicer error message could be warranted (and the program could recover). If it's hardware we're running on, like ram or CPU errors, then I'd say all bets are off and killing the program is probably reasonable.
I quite like rust's separation of these two concepts - "recoverable errors" are in your face with Result, and unrecoverable ones, like program bugs, unconditionally unwind the stack and crash.
There's a bit of an odd situation where panics only crash a single thread, and not the whole program, but they can often be propagated through the program through poisoned mutexes and closed channels anyways.
I have heard that argument a lot. I think it is obviously false. Consider:
A simple program to add two numbers can produce the correct answer or it can fail. One has to think about what do do in both cases. In the happy case we might want to print the result. In the sad case what? Crash an burn? Exit with nothing? Print the wrong result? Might be nice to think about it and do something helpful like print "Overflow error".
Sure exception keep the error out of the happy path so you don't have to think about it there. But you have to think about it somewhere no matter what mechanism you have to detect errors.
Scale that up to the thousands of errors that can happen in a large program and add the fact that we often want to keep running in the face or errors (Unless they are truly exceptional). There is no "less thinking" about it any which way.
Given all that we see that hiding the error situations under the rug with exceptions really obfuscates what you need to think about.
To my mind "truly exceptional" you cannot handle. Better to die immediately.
As a Conclusion of the Analysis of the concrete Use Case of UTF8Error Handling as discussed at:
I found that the correct Processing and Recovery of the UTF8Error bloats up the Application Logic and thus produces a measurable increment of the Processing Time
BTW. Is there something preventing compilation of unhappy path of (at least some) code, which uses Results, into side-tables? Like it is done with exceptions.
I'm curious. Do you have a github repo or such that contains both Rust and whatever other language solutions to that problem? I'd like to see what is going on there.