~/talk

Refactoring with ASTs and Pattern Matching

Talkat RubyKaigi 2024 · 2024-05-15..05-17· [ruby]
slides:none on file

Demonstrates using Ruby ASTs and pattern matching to find and rewrite code shapes—example: automatic conversion of block patterns like {|v| v.foo } into &:foo via a RuboCop rule built with tree rewriter and pattern matching that extracts receiver and arg. Compares parsers Ripper -> whitequark -> prism, notes prism gives ~5x speedup and RuboCop corrections moving from minutes to seconds on multi-million‑line projects. Shows shape-based counting across large repos (hundreds per pattern), a working refactor rule, and LLMs producing almost‑complete parser code.

AI-written summary · about

  1. 0:00Understanding ruby parsers
  2. 2:00Parser tools and evolution
  3. 6:34The role of Prism
  4. 9:45Introduction to pattern matching
  5. 13:51Applying pattern matching
  6. 18:45Future of Ruby tooling
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.