LambdaLab: an interactive λ-calculus reducer for learning

In advanced programming languages curricula, the λ-calculus often serves as the foundation for teaching the formal concepts of language syntax and semantics. LambdaLab is an interactive tool that helps students practice λ-calculus reduction and build intuition for its behavior. To motivate the tool, we survey student answers to λ-calculus assignments in three previous classes and sort mistakes into six categories. LambdaLab addresses many of these problems by replicating the experience of working through examples with an instructor. It uses visualizations to convey AST structure and reducible expressions, interactive reduction to support self-guided practice, configurable reduction strategies, and support for encodings via a simple macro system. To mimic informal, in-class treatment of macros, we develop a new semantics that describes when to expand and contract them. We use case studies to describe how LambdaLab can fit into student workflows and address real mistakes.