# Elixir Level 10: Metaprogramming

> Level 10: Metaprogramming of the LoWisa Elixir course: Macros, Quote and Unquote, Compile-Time Extension. 3 lessons and 9 ideas, each explained in one line.

Metaprogramming is level 10 of 16 of the [LoWisa Elixir course](/courses/elixir/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Macros

- **Macros.** A **macro** receives code as data and returns code: Elixir extending itself at compile time.
- **AST.** Elixir code is quotable **AST**: three-element tuples the macro system rewrites.
- **Macros in the wild.** The ecosystem’s elegance is macros: routers, schemas and **tests** are macro-built DSLs.

## Quote and Unquote

- **quote.** **quote** captures code as AST: the raw material macros transform.
- **unquote.** **unquote** splices values into quoted code: templates filled at compile time.
- **Hygiene.** Elixir macros are **hygienic**: their variables cannot silently capture yours.

## Compile-Time Extension

- **use and __using__.** **use** invokes a module’s __using__ macro: the injection point behind every framework DSL.
- **Compile-time checks.** Macros can **validate** at compile time: wrong configuration failing the build, not the runtime.
- **Macro restraint.** The first rule of macros: don’t: reach for them when **functions** provably cannot.

## Before and after this level

- **Before:** [Level 9: Mix & Hex](/courses/elixir/level-9-mix-and-hex/): Projects, Dependencies, Packages and Libraries.
- **Next:** [Level 11: Distributed Elixir](/courses/elixir/level-11-distributed-elixir/): Nodes, Clustering, Distributed Failure.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Elixir Level 10: Metaprogramming cover?

Macros, Quote and Unquote, Compile-Time Extension: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 9: Mix & Hex, which covers Projects, Dependencies, Packages and Libraries.

## Learn Elixir on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/elixir/level-10-metaprogramming/ · Updated 2026-11-25
