Writing DSL's with Parslet
summary
Rewrites RedCloth from brittle regex and opaque Regal tables into a Parslet parser in pure Ruby so no C ext or compilation is required, making fixes and contributions practical; Regal’s compiled rewrite once ran about 40x faster than gsub but became a maintenance black box, and treetop proves too slow. Parslet gives clear failure tree debugging, transformers for reducing parse hashes, accelerators and custom atoms to speed hotspots, and overall performance that proves usable.
AI-written summary · about
chapters (9)
- 0:00Introduction and context
- 1:30Domain specific languages
- 5:00External DSLs explained
- 7:03The journey to Parslet
- 13:38Working with Parslet
- 17:19Implementation details
- 24:01Testing and optimization
- 27:28Advanced use cases
- 30:03Conclusion and Q&A
related talks
43mGrammars, Parsers, and Interpreters, In Ruby
51mForbidden Fruit: A Test of Ruby's Parse Tree
38mParsing Expressions in Ruby
29mSmalruby: Visualizing Ruby with Bidirectional Transpiration
25mMore DSL, Less Pain
32mParsing Ruby
30mSorbet at Grailed: Typing a Large Rails Codebase to Ship with...
36ms/regex/DSLs/: What Regex Teaches Us About DSL Design
