~/talk

Time flies like an arrow; Fruit flies like a banana: Parsers for Great Good

Talkat RubyKaigi 2015 · 2015-12-11..12-13· [ruby, compilers-and-language-design]
links:none on file
slides:none on file

Examines how code gets tokenized and parsed, showing a Ruby lexer/tokenizer and hand‑written expression parser that handles parentheses and operator precedence, and explaining how a parser.rb generated from parser.y (via racc or bison) differs from ad‑hoc regexes. Demonstrates recursive descent vs shift‑reduce parsing, explains why many inputs (URLs, lockfiles) are not regex‑parsable, shows RubyGems using a lexer+parser while Bundler uses fragile regexes, and argues parsers give faster, more reliable results (routing becomes logarithmic).

AI-written summary · about

  1. 0:00Intro
  2. 0:53My name
  3. 1:31How I found parsers
  4. 3:38Lets play a game
  5. 6:12Garden path sentences
  6. 8:00Grammar rules
  7. 8:48BNF notation
  8. 10:13Production rules
  9. 11:50Tokenizing
  10. 13:40More complicated rules
  11. 14:23Topdown parser
  12. 17:34Recursion parser
  13. 18:32Shift reduce parser
  14. 22:10Parser generators
  15. 23:18Parser tables
  16. 23:43Parser in action
  17. 24:21When to use a parser
  18. 25:25The savage hierarchy
  19. 26:54A B language
  20. 28:02Grammar
  21. 29:24Lockfile
  22. 30:36Conclusion
~/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.