Mongrel Monads, Dirty, Dirty, Dirty
summary
Compares C, C++98 exceptions, C++11 std::error_code and the WG21 expected proposal, benchmarks on GCC 6.2, Clang 4 and MSVC 2017, and shows throwing a C++ exception across 10 stack frames costs ~30,000 CPU cycles while integer/expected returns cost ~100 cycles. Introduces a Boost-style implementation called outcome that offers option/result/outcome transports, a lightweight, low-overhead ABI-stable library with monadic helpers (opt-in) and extensive tests and assembler-size checks.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:18Error handling overview
- 2:00C++11 error codes
- 8:02C++98 exceptions
- 13:01System error design
- 24:34Error codes in practice
- 30:12Expected proposal
- 45:18Rust comparison
- 55:30Expected use case
- 57:02Performance benchmarks
- 1:07:32Benchmark results
- 1:18:28Choosing error handling
- 1:20:13Boost Outcome proposal
- 1:30:15Q&A
related talks
59m“The Exception Situation"
55mExceptions Under the Spotlight
01h 00mThe Dawn of a New Error
54mMonadic Operations in Modern C++: A Practical Approach
40mLessons from two decades of writing bad code
01h 13m"Mostly Invalid": flat_map, Exception Guarantees, and the STL
58mOO Considered Harmful
55mI Wish I Could Use C++ 1x/y/z
