We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Exploration of Metaprogramming in Elixir Through Rebuilding the ESpec Testing Framework
83
clicks
Source: youtube.com
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.
Related posts
© HashMerge 2024