~/talk

High-Level Effect Handlers in C++

Talkat OOPSLA 2022 · 2022-12-05..12-10· [compilers-and-language-design]
slides:none on file

cpp-effects is a C++ library that implements deep, affine effect handlers on top of boost.context fibers, with handlers expressed as classes using multiple inheritance and optional named handlers to avoid RTTI. Examples include state, lightweight threads, actors and generators; resumptions capture delimited continuations (non-duplicable) and lifetimes use reference counting. Benchmarks show plain (non-resuming) commands are about 10x slower than direct globals but often competitive and sometimes faster than C++20 coroutines or libmprompt; exception interop is currently limited.

AI-written summary · about

  1. 0:00Start
  2. 1:59Effects
  3. 3:58Effect handlers as composable user-defined operating systems
  4. 11:02flat handlers and plain commands
  5. 12:04lightweight threads with a kill command
  6. 14:35Example 6: async/await Futures
  7. 15:05generators
  8. 18:13Design summary
  9. 18:48Inheritance hierarchy for handlers
  10. 19:31Invoking a command
  11. 20:04Flat stack versus nested stack with pointers to stacklets (fibers)
  12. 20:19Implementation
  13. 20:54State using Clang natively (average time per iteration in ns)
  14. 22:24Generating a number (in ns)
  15. 22:55Recursive tree traversal (ns per node)
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.