~/talk

Write Less, Do More (and Have Fun!) with Elixir Macros

Talkat Erlang Factory SF Bay Area 2014 · 2014-03-06..03-07· [elixir-and-erlang]
slides:none on file

Claims that macros let code write code are demonstrated by building an assert macro and mini testing DSL that pattern matches quoted AST (three-element tuples) via quote/unquote and returns detailed failure messages. Tools used: Elixir macros, compile-time evaluation, pattern-matching, apply. A 20,000-line Unicode data.txt is read at compile time to generate thousands of do_upcase functions for correct Unicode uppercasing. A router.match functions generated routing layer is compiled to performant pattern-matching dispatch. Examples compile and run; the GitHub-demo works but embeds external data at compile time (risky).

AI-written summary · about

  1. 0:00Introduction to Elixir
  2. 1:14Understanding Elixir macros
  3. 3:20Rule of macros
  4. 6:05Internal code representation
  5. 9:02Writing an assert macro
  6. 14:22Building a testing DSL
  7. 17:38Advanced test macros
  8. 25:28Real world unicode handling
  9. 31:23Routing in Phoenix
  10. 37:26Macro conveniences
  11. 39:09Fun with macros
  12. 42:35Conclusion and Q&A
~/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.