Commit 80c5b3d
doc: add exception handling mechanism and CRuby contrast (#897)
Document monoruby's raise/unwind/rescue pipeline and how it differs from
CRuby, centered on the laziness that keeps the raise path cheap:
- MonorubyErr (in-flight Rust error) vs the lazily-materialized Ruby
exception object (take_ex_obj).
- The two families of MonorubyErrKind: real exceptions vs control-flow
pseudo-exceptions (return/break/throw/retry/redo/fatal), and why the
latter are dispatched before any trace capture.
- handle_error as the per-frame unwinder, the per-method exception table,
ensure deferral, and $! restoration.
- Backtrace construction: incremental capture on unwind, the catch-time
caller walk (complete_backtrace_for_rescue) as the last coherent
snapshot point, lazy string formatting + memoization, and why loop's
StopIteration pays almost nothing.
- Point-by-point CRuby contrast (eager-at-raise snapshot vs
deferred/incremental) and a hot-path cost table.
Captures the findings from the Exception#backtrace work (#896).
Claude-Session: https://claude.ai/code/session_01XpzdoFu46d2ChJpSzeWsNK
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8753ca6 commit 80c5b3d
1 file changed
Lines changed: 388 additions & 0 deletions
0 commit comments