Composable Sequence Macros for Fast Iteration
summary
Racket gets a library of fast-sequence map/fast-sequence filter and a generalized do-sequence comprehension that builds by manipulating compile-time expanded clause records (ECRs) containing binders and expressions, with careful scoping rules and diagnostics. Implementation composes sequence macros to avoid intermediate allocation, targets mapping/filtering/nesting, and benchmarks show about 18× speedup over dynamic sequences and performance close to hand-optimized loops, with minor slowdowns due to ECR representation limits.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:05Dynamic sequence problems
- 2:28Fast sequence combinators
- 3:34For loops in Racket macros
- 5:43Loop scoping challenges
- 7:32Nested iteration with custom types
- 8:37Results and benchmarks
- 9:45Q&A
related talks
01h 03mModern Macros
23mMacro-embedding Compiler Intermediate Languages in Racket
40mLet's Build a Hygienic Macro Expander
37mMetaprogramming + DSL Design in Elixir
25mRewriting Macros on the Fly: A Modular Approach to Administrative Reduction During(…)
42mThe Macronomicon
56mRhombus: The Non-shrubbery Parts (Keynote)
42mAvoiding macros with inline and derived
