Erlang metaprogramming made easy: Richard Carlsson

512 views · Published 5 June 2012 · 49:37 · Indexed 29 September 2026

Channel: Erlang Solutions · 2012 · Science & Technology

Watch on YouTube

Erlang Factory SF Bay Area 2012

www.erlang-solutions.com
www.erlang-factory.com

"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. "

Follow us on Twitter @Erlangfactory  https://twitter.com/#!/erlangfactory 
Join our group on Linkedin Erlang Factory  http://www.linkedin.com/groups/Erlang-Factory-2003110?trk=myg_ugrp_ovr

More from this channel