Tracing and Debugging Functional Programs

Tracing enables the programmer to see how different parts of the program cause a computation to perform its observed input/output actions. Tracing is used primarily for debugging, that is, for localising the faulty program part that causes an undesirable observable behaviour. For declarative languages new tracing methods that are different from, and arguably more powerful than, conventional methods for imperative languages have been developed. These methods take advantage of the purity of declarative languages, that is, explicit data flow and absence of side effects. Functional languages are particularly suitable for these methods, because they have simple and well-studied semantics, and lazy functional languages are the most widely used completely pure programming languages.

In 2000 Colin Runciman, Malcolm Wallace and I started developing the Haskell tracing tool Hat. Since then I continue improving Hat, its underlying theory and related techniques with various collaborators.

Work

Selected Papers

Software

Hat
is a source-level tracer for Haskell. Often, programmers find it difficult to understand how the different parts of a program cause the computation to perform the observed input/output actions. Hat enables a user to see and interactively explore the usually invisible computation. Thus Hat assists with debugging, understanding complex programs (which we may not have written ourselves) and is useful for teaching.
COOSy
is a library plus viewing tool for lightweight debugging of functional logic programs in Curry by observations. The programmer annotates expressions of interest in their program. With the viewing tool the programmer then views the values the annotated expressions have in a computation.