~/talk

Liberating Ruby's Parser from Lexer Hacks

Talkat RubyKaigi 2026 · 2026-04-22..04-24· [ruby, compilers-and-language-design]
slides:none on file

Claim: replacing ad hoc lexer flags with a parser-aware scanner (PSR) exposes the real causes of Ruby syntax confusion and lets the lexer stop guessing. The implemention builds a pseudo-scan FSA plus a parser-state accept table, adds functions like accept_token and where_state to follow empty reductions or inspect the parser stack, and performs state-splitting to undo harmful LR-state merges. Results: it explains six layers of ambiguity, removes most of the 13-bit / ~100-site lexer hacks, and makes lexer decisions deterministic.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 1:49Speaker introduction
  3. 6:26Traditional LR parser limitations
  4. 8:52PSR scanner parser relationship
  5. 11:44Layer one parser state answers
  6. 13:29Layer two empty reductions
  7. 15:15Layer three parser stack lookup
  8. 16:39Layer four token boundaries
  9. 20:14Layer five state merging issues
  10. 22:25Layer six semantic ambiguity
  11. 23:50Six layers ambiguity map
  12. 24:11Practical results of PSR
  13. 25:14Three key takeaways
  14. 26:00Q&A and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.