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

Chris McCord
Elixir Enthusiast

Elixir macros give programmers the power to write code that writes code. This power eliminates boilerplate, allows Domain Specific Language abstractions, and provides the freedom to extend the language. Leveraging the fact that it can be represented by its own data structures, Elixir can interrogate its own code to peer in for analysis or to add additional functionality. Used appropriately, macros offer effective module composition and code generation techniques, while more liberal use can serve as an outlet for novel insights through experimentation.

Starting from the basics of macros, we'll explore these ideas from an introductory level through advanced topics and real-world use-cases. Along the way, we'll see how Elixir uses meta-programming to generate parts of its own standard library. We'll also examine how macros can be used to save time and share functionality in a fun and productive way.

Whether a beginner or seasoned Erlang developer, you'll leave with a great overview of what is possible with Elixir macros and, with any luck, a strong desire to keep digging.

Talk objectives:

The goals of this talk are to demonstrate the productive benefits of Elixir macros and how they provide a landscape for writing fun and insightful programs.

Target audience:

This talk is for any seasoned Erlang developer as well as beginners who are interested in the Elixir programming language and what macros have to offer.

Slides
Video

Chris McCord is the creator of the Phoenix framework, and author of Metaprogramming Elixir and Programming Phoenix. He spends his days crafting OSS and web applications at DockYard. His current interests focus on new web technologies, distributed programming, and teaching others the tools of the trade.


GitHub: chrismccord

Twitter: @chris_mccord

Back to conference page