~/talk

Ruby ate my DSL!

Talkat RubyConf 2019 · 2019-11-18..11-20· [ruby]
slides:none on file

Claim: DSLs are still just Ruby so user code can stomp internals. Demonstration builds a tiny nanospec (about 20 lines of code) that mostly works but breaks when user code runs via instance_eval, e.g. Sinatra’s private invoke collision. Techniques shown: prefix internal names, split the DSL interface from its implementation and delegate, minimize scope by extending only the main object, prefer class modeling and class_eval for lexical helpers, avoid BasicObject, and provide alternatives to constants (RSpec’s let) to make the DSL behave more like Ruby.

AI-written summary · about

  1. 0:00Intro
  2. 1:28Sinatra bug
  3. 4:15Introduction
  4. 7:43Rails
  5. 9:16Extending Ruby
  6. 18:30Rehave
  7. 21:41Helper Methods
  8. 25:35lexical scoping
  9. 31:51constants
  10. 33:11provide alternatives
  11. 33:59recap
  12. 34:58DSL vs Ruby
~/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.