Growing Your Types Without Growing Your Workload, or How To Survive Among Productive Colleagues in Rust, or Defense Against the Dark Arts


This is a talk on how Rust derive macros make the eocnomics of some solutions to the expression problem simpler.

Derive macros allow the programmer to generate a wrapper enum that statically closes over an open hierarchy of types, and dispatches on each of its variant. That eliminates one of the known issues with type class-based solutions to the expression problem, which is that the boilerplate necessary to close over a specific set of such variants is either cumbersome or requires dynamic dispatch at a performance cost.