3 ms·
> Related: Only zig has fast errors with traces. Other languages have no traces or a high performance cost. Look up error return traces in the docs. Out of cur
by bluejekyll 8y ago
> Related: Only zig has fast errors with traces. Other languages have no traces or a high performance cost. Look up error return traces in the docs.
Out of curiosity, have you compared this to Rust’s backtrace mechanism? I’d be interested in the perf difference, if it’s available.
- dbaupp 8y agoRust's panics and their backtrackes are essentially the same as C++ exceptions.
- bluejekyll 8y agoI wasn’t actually thinking about panic, but the associated optional backtrace in Error types with Failure, for example: https://docs.rs/failure/0.1.3/failure/ https://docs.rs/failure/0.1.3/failure/
- dbaupp 8y agoAh, I see. Looking at the source code https://docs.rs/crate/failure/0.1.3/source/src/backtrace/internal.rs https://docs.rs/crate/failure/0.1.3/source/src/backtrace/int..., "failure" uses https://docs.rs/backtrace/0.3.9/backtrace/struct.Backtrace.html#method.new_unresolved https://docs.rs/backtrace/0.3.9/backtrace/struct.Backtrace.h... which is the callstack at a single point, not a trace of how an error was propagated.