Rappel: Compose Algorithms, Not Iterators - Google's Alternative to Ranges
summary
Rappel (RPL) is a Google library that composes algorithms instead of iterators, implementing an eager continuation passing style pipeline that passes values through stages rather than returning temporaries. It eliminates dangling-reference and repeated-transform bugs common with std::ranges, cuts stack growth from cubic to near-linear, and gives monadic error handling (optional / status_or unwraps) built-in. compose vs apply separates pipeline construction from execution; benchmarks show performance close to handwritten loops and it’s been in internal use since July.
AI-written summary · about
chapters (25)
- 0:00Introduction to Repel
- 0:32Historical context
- 2:04Defining the pipeline style
- 3:25Stages of a pipeline
- 4:11C++20 ranges overview
- 5:10Identifying ranges pitfalls
- 7:06Dangling reference analysis
- 8:34The TPOISA problem
- 10:17Stack overflow and growth
- 12:06Comparing iterators and algorithms
- 13:53Continuation passing style
- 15:47Safety and efficiency trade-offs
- 17:43Introduction to Repel library
- 20:13Benchmarking and performance
- 24:31Implementing complex examples
- 31:28Refining the pipeline design
- 33:20Incremental vs complete processing
- 35:43Pipeline rules and safety
- 39:20Enforcing safety in apply
- 43:06Standardizing stages and safety
- 46:10Library internals
- 50:59Error handling and monads
- 56:30Convenience features
- 1:02:11Final case study: word count
- 1:06:56Q&A and future outlook
related talks
46mMeandering Through C++ Creating ranges::to
01h 31m105 C++ Algorithms in 1 line* of Raku (*each)
17mComposable Sequence Macros for Fast Iteration
01h 01mFunction Composition in Programming Languages
47mA Journey into Ranges, Views, Pipelines, and Currying
48mThe Power of Function Composition
25mReinventing Rollup
04mGeneralized fold expressions
