ExPanda
Full macro expansion engine for Elixir AST introspection and debugging.
expands Elixir macros recursively to reveal underlying AST constructs for introspection, debugging, and static analysis.
The Pitch
Elixir's macro system enables powerful domain-specific languages like Ecto, Phoenix, and Absinthe. However, debugging multi-layer macro expansions or performing static analysis on macro-generated code can feel like peering into a black box.
ExPanda recursively unfolds Elixir macros until only core language AST nodes remain. See the exact code generated by nested macros, trace expansion steps, and feed clean expanded ASTs into linters and static analysis engines.
Why ExPanda?
Full Recursive Macro Expansion
Expands nested macros completely down to primitive Elixir AST constructs.
Step-by-Step Expansion Tracing
Inspect step-by-step intermediate macro states to pinpoint where unexpected AST transformations occur.
Environment-Aware Expansion
Respects module contexts, aliases, and imports during macro expansion.
Tooling Foundation
Serves as an AST normalization layer for static analyzers, code formatters, and refactoring tools.
The Tech
| Language | Elixir |
| Primary Task | Recursive Macro Expansion & AST Normalization |
| Target | Macro Debugging & Static Analysis |
| Hex Package |
ex_panda
|
Who It's For
- Metaprogramming & Macro Authors debugging complex nested macro expansions in Elixir libraries.
- Static Analysis Tool Builders needing fully expanded code before running AST inspection passes.
- Curious Elixir Engineers desiring deep insight into how Phoenix and Ecto DSL macros expand.
Bottom Line
Unfold complex Elixir macro pipelines down to pure AST constructs with ExPanda.