How does Lrama make the Ruby parser grammar G.O.A.T.?
summary
Lrama replaces GNU Bison as Ruby’s parser generator (now used in Ruby 3.3) and is built and maintained by a three-person team; it outputs LR parsers and eliminates brittle bison hacks by adding named references for clear semantic access, parameterizing rules to factor repeated grammar patterns, and a standard rule library (option, list, node-list) so common patterns are embedded. The result is a produced parser that compiles across different bison environments, simplifies the old “Demon Castle” pass.rb, and is already running in the language.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 4:08What is Lrama
- 7:50Ruby parsing components
- 12:19Context-free grammar basics
- 16:43Ruby's BNF in parse.y
- 17:04Bison grammar problems
- 20:22Named references in rules
- 21:50Parameterizing rules
- 25:14Standard library of rules
- 26:41Lrama improves Ruby grammar
- 27:48Future of Ruby grammar
related talks
46mGrammar a BNF like Ruby DSL Parsing
32mParsing Ruby
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
48mRapid Programming Language Prototypes with Ruby RACC
41mWriting Lint for Ruby
26mLiberating Ruby's Parser from Lexer Hacks
43mGrammars, Parsers, and Interpreters, In Ruby
52mTreetop: Syntactic Analysis with Ruby
