Seminar at Lund University
Talk: Seeing Programs as Trees in Programming Education
Lund University, Lund, Sweden
Fri, Oct 30, 2026Abstract
Programs are usually presented as text, but programming languages impose a hierarchical structure on that text. Abstract syntax trees (ASTs) make this structure explicit, representing programs in terms of their language constructs and the relationships between them. While ASTs are fundamental to compilers, interpreters, and program analysis tools, they can also serve an educational purpose.
In this talk, we explore how tree representations of programs can support programming education by providing a “notional machine”: a conceptual model for understanding programs, reasoning about language features, and identifying errors. We present a study investigating the kinds of mistakes that become apparent when program expressions are represented as trees. We then introduce PyTamaro, a Python graphics library designed for educational programming, and TamaroCards, a visual, tree-based representation of PyTamaro expressions. Finally, we present a survey of high-school informatics teachers showing that they favor detecting name and type errors statically, before program execution, even in Python. They also see value in type annotations when these enable additional checks.
Together, these contributions explore how making program structure and properties explicit can help learners and teachers reason about programs and programming errors.