Creating a domain-specific language

You may recall the chapter where we used GenStage to implement our upload and download pipelines. This enabled us to define each step role, and the GenStage behaviour would handle the subscription and message-passing logic between steps, ensuring that no step would get boggled with too many events.

We now want to improve on what we accomplished previously, by streamlining the pipeline and steps definition. To make this happen, we will create our very own Domain-Specific Language (DSL) to help define GenStage-based pipelines, with the help of some interesting macro tools. This will allow us to remove the boilerplate from our pipeline definitions and improve their expressiveness.

Given that, with macros, ...

Get Mastering Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.