Tracing piece by piece: affordable debugging for lazy functional languages

  • Authors:
  • Henrik Nilsson

  • Affiliations:
  • Department of Computer and Information Science, Linköpings universitet, Sweden, and INRIA Sophia Antipolis, France

  • Venue:
  • Proceedings of the fourth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

The advantage of lazy functional languages is that programs may be written declaratively without specifying the exact evaluation order. The ensuing order of evaluation can however be quite involved which makes it difficult to debug such programs using traditional, operational techniques. A solution is to trace the computation in a way which focuses on the declarative aspects and hides irrelevant operational details. The main problem with this approach is the immense cost in time and space of tracing large computations. Dealing with these performance issues is thus the key to practical, general purpose debuggers for lazy functional languages. In this paper we show that computing partial traces on demand by re-executing the traced program is a viable way to overcome these difficulties. This allows any program to be traced using only a fixed amount of extra storage. Since it takes a lot of time to build a complete trace, most of which is wasted since only a fraction of a typical trace is investigated during debugging, partial tracing and repeated re-execution is also attractive from a time perspective. Performance figures are presented to substantiate our claims.