CSI: Haskell - Tracing Lazy Evaluations in a Functional Language

Matthías Páll Gissurarson, Leonhard Herbert Applis

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

4 Downloads (Pure)

Abstract

In non-strict languages such as Haskell the execution of individual expressions in a program significantly deviates from the order in which they appear in the source code. This can make it difficult to find bugs related to this deviation, since the evaluation of expressions does not occur in the same order as in the source code. At the moment, Haskell errors focus on values being produced, whereas it is often the case that faults are due to values being consumed. For non-strict languages, values involved in a bug are often generated immediately prior to the evaluation of the buggy code. This creates an opportunity for evaluation traces, tracking recently evaluated locations (which can deviate from call-order) to help establish the origin of values involved in faults. In this paper, we describe an extension of GHC's Haskell Program Coverage with evaluation traces, recording recent evaluations in the coverage file, and reporting an evaluation trace alongside the call stack on exception. This lets us reconstruct the chain of events and locate the origin of faults. As a case study, we applied our initial implementation to the nofib-buggy data set and found that some runtime errors greatly benefit from trace information.

Original languageEnglish
Title of host publicationProceedings of the 2023 35th Symposium on Implementation and Application of Functional Languages, IFL 2023
PublisherACM
ISBN (Electronic)9798400716317
DOIs
Publication statusPublished - 2023
Event35th Symposium on Implementation and Application of Functional Languages, IFL 2023 - Braga, Portugal
Duration: 29 Aug 202331 Aug 2023

Publication series

NameACM International Conference Proceeding Series

Conference

Conference35th Symposium on Implementation and Application of Functional Languages, IFL 2023
Country/TerritoryPortugal
CityBraga
Period29/08/2331/08/23

Keywords

  • Errors
  • Fault-Localization
  • Laziness
  • Tracing

Fingerprint

Dive into the research topics of 'CSI: Haskell - Tracing Lazy Evaluations in a Functional Language'. Together they form a unique fingerprint.

Cite this