3 ms·
I guess, you're talking about library code. Libraries should use Result on their API boundaries, that's for sure. If library internals wants to use exceptions-p
by vbezhenar 6y ago
I guess, you're talking about library code. Libraries should use Result on their API boundaries, that's for sure. If library internals wants to use exceptions-panics, I think that language should allow it, because that's an implementation detail and compiler should allow modules with different panic configurations to co-exist (for example library can use unwinding panic, but as soon as it leaves library boundary, application will abort if it's configured to abort on panic). If it's not possible to implement in a sane way, then I'm OK with libraries forced to use Results as the only error-handling strategy, because I'm more concerned about program code.
- steveklabnik 6y agoIn a systems language, implementation details matter :) You may be compiling with panic=abort because you do not have a useful unwinding implementation, and so a library cannot depend on it existing, even if it's only internal to the library.
- masklinn 6y ago> You may be compiling with panic=abort because you do not have a useful unwinding implementation, and so a library cannot depend on it existing, even if it's only internal to the library. panic=abort is also a somewhat commonly suggested way of slimming down binaries.
- deleted 6y ago[deleted]