Exploration of Metaprogramming in Elixir Through Rebuilding the ESpec Testing Framework

39
clicks
Exploration of Metaprogramming in Elixir Through Rebuilding the ESpec Testing Framework

Source: youtube.com

Type: Video

Bruce Park gave a presentation at EMPEX LA 2019 focused on the concept of metaprogramming within the Elixir programming language, particularly in the context of rebuilding a BDD testing framework known as ESpec. He starts with an engaging analogy comparing metaprogramming to building a factory that makes factories, which in essence is about writing code that generates more code. He explains the motivation behind exploring metaprogramming, despite warnings against its complexity, is rooted in curiosity and the desire to understand deeper layers of Elixir. Park goes into the basics of BDD and how domain-specific languages (DSLs) like RSpec (a Ruby framework) have influenced ESpec. The core of his talk delves into abstract syntax trees (ASTs), macros, and how to use them to build a simple version of ESpec. He provides guidelines from Sasha Urich and Chris McCord on when it's appropriate to use metaprogramming and shares an overview of how to implement assertions within a BDD framework through macros. Park concludes with reflecting on macro usage for reducing boilerplate code and provides resources and pointers for those interested in digging into Elixir's metaprogramming capabilities.

© HashMerge 2024