Erlang Factory SF Bay Area 2012

To generate Erlang code dynamically, you have until now had two choices: you could either create plain tuples according to the "abstract format" as generated by erl_parse (which is messy and has many special cases to keep in mind), or you could use the API functions in the erl_syntax module (which offer more abstraction, but can get pretty verbose). This talk will present the missing ingredient; a library allowing you to use template strings with metavariables, both for generating and matching on abstract syntax trees. As examples, I will show how we have used this at Klarna to implement a small domain-specific language for business logic, and demonstrate how you too can easily write a parse transform and even implement your own DSL that compiles to Beam code.

Rated: Everyone
Viewed 1,000 times
Tags: There are no tags for this video.