Text Processing in APL
summary
Claim: APL handles real-world text parsing by replacing recursive PEG-style parsers with data-parallel linear passes that tokenize, compute delimiter depths with a sum-scan depth trick, convert depth to a depth→parent vector to build ASTs and report errors, and run type/link analyses as isolated passes. Implementation: a new co-dfns linear passes parser used in the compiler. Result: it works and scales — measured at roughly 62× speedup versus the old recursive interpreter-heavy parser.
AI-written summary · about
chapters (12)
- 0:00APL for processing text data
- 1:20Most text parsing tasks result in a structured model such as a tree
- 2:00Regular expressions (regex) are convenient but limited
- 3:44Parsing expression grammars are recursive
- 5:38Issues with a recursive parser
- 7:50Performance of recursive parsers
- 9:21How to do data-parallel, idiomatic parsing
- 11:32Balanced parentheses example
- 15:12High level overview of the new co-dfns parser
- 17:50Link variables to their bindings example
- 20:22Parsing strands example
- 21:42Notes on flexibility, maintainability and performance
