~/talk

Ruby Macros

Talkat MountainWest RubyConf 2010 · 2010-03-11..03-12· [ruby]
links:none on file
slides:none on file

A working Ruby macro system is presented that manipulates syntax trees at parse time and inlines code: macro runs at parse time, accepts arguments as S‑expressions, and returns parse trees that are spliced into callers. Implementations shown include an assert macro that inspects source to produce better error messages, a loop unroller and an inline-method transformation; a custom parser (redparse) produces object‑oriented trees but is slow, macros are global and unhygienic, require a special require and currently target Ruby 1.8—functional but with startup and scoping limits.

AI-written summary · about

  1. 0:00Introduction
  2. 0:38C Macros
  3. 1:15List Macros
  4. 1:50Macros
  5. 3:37S Expressions
  6. 4:40Arguments
  7. 5:31Forms
  8. 6:26Tree
  9. 7:42Form Escape
  10. 9:15debug
  11. 17:11red parse
  12. 20:01macro issues
  13. 23:41loop unrolling
  14. 24:51inline macro
~/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.