skip to main content
research-article

Algorithmic debugging of real-world haskell programs: deriving dependencies from the cost centre stack

Published:03 June 2015Publication History
Skip Abstract Section

Abstract

Existing algorithmic debuggers for Haskell require a transformation of all modules in a program, even libraries that the user does not want to debug and which may use language features not supported by the debugger. This is a pity, because a promising approach to debugging is therefore not applicable to many real-world programs. We use the cost centre stack from the Glasgow Haskell Compiler profiling environment together with runtime value observations as provided by the Haskell Object Observation Debugger (HOOD) to collect enough information for algorithmic debugging. Program annotations are in suspected modules only. With this technique algorithmic debugging is applicable to a much larger set of Haskell programs. This demonstrates that for functional languages in general a simple stack trace extension is useful to support tasks such as profiling and debugging.

Skip Supplemental Material Section

Supplemental Material

References

  1. T. O. Allwood, S. Peyton Jones, and S. Eisenbach. Finding the needle: stack traces for GHC. In Proceedings of the symposium on Haskell, pages 129–140. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. O. Chitil. Source-based trace exploration. In Proceedings of Implementation and Application of Functional Languages, LNCS 3474. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. O. Chitil and T. Davie. Comprehending finite maps for algorithmic debugging of higher-order functional programs. In Proceedings of the Principles and practice of declarative programming. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. O. Chitil, C. Runciman, and M. Wallace. Transforming Haskell for tracing. In Implementation of Functional Languages, LNCS 2670, pages 165–181. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the International Conference on Functional Programming, volume 46, pages 268–279. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Faddegon and O. Chitil. Type Generic Observing. In Proceedings of Trends in Functional Programming, LNCS 8843. Springer, 2014.Google ScholarGoogle Scholar
  7. A. Gill. Debugging Haskell by Observing Intermediate Data Structures. Electronic Notes in Theoretical Computer Science, 41, 2000.Google ScholarGoogle Scholar
  8. ACM SIGPLAN Workshop on Haskell.Google ScholarGoogle Scholar
  9. J. Launchbury. A natural semantics for lazy evaluation. In Principles of programming languages, pages 144–154. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Marlow. Solving an old problem: How do we get a stack trace in a lazy functional language? Haskell Implementors Workshop, http://community.haskell.org/~simonmar/ Stack-traces.pdf, 2012.Google ScholarGoogle Scholar
  11. S. Marlow, J. Iborra, B. Pope, and A. Gill. A lightweight interactive debugger for Haskell. In Proceedings of the Haskell workshop, pages 13–24. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. G. Morgan and S. A. Jarvis. Profiling Large-Scale Lazy Functional Programs. Journal of Functional Programming, 8(3):201–237, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Naish. A declarative debugging scheme. Journal of Functional and Logic Programming, 3, 1997.Google ScholarGoogle Scholar
  14. H. Nilsson. Declarative debugging for lazy functional languages. PhD thesis, Linköpings universitet, 1998.Google ScholarGoogle Scholar
  15. H. Nilsson and P. Fritzson. Algorithmic debugging for lazy functional languages. In Programming Language Implementation and Logic Programming, pp. 385–399. Springer LNCS 631, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. H. Nilsson and J. Sparud. The evaluation dependence tree as a basis for lazy functional debugging. Automated Software Engineering, 4(2): 121–150, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Pareja, R. Pena, F. Rubio, and C. Segura. Adding traces to a lazy monadic evaluator. In Computer Aided Systems Theory—EUROCAST 2001, pages 627–641. Springer LNCS 2178, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Pope. Declarative Debugging with Buddha. In Advanced Functional Programming, pages 273–308. Springer LNCS 3622, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. B. Pope. A Declarative Debugger for Haskell. PhD thesis, The University of Melbourne, Australia, 2006.Google ScholarGoogle Scholar
  20. P. M. Sansom and S. L. Peyton Jones. Formally based profiling for higher-order functional languages. ACM Transactions on Programming Languages and Systems (TOPLAS), 19(2):334–385, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Sestoft. Deriving a lazy abstract machine. Journal of Functional Programming, 7(3):231–264, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. Y. Shapiro. Algorithmic program debugging. MIT press, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Silva. A comparative Study of Algorithmic Debugging Strategies. In Logic-Based Program Synthesis and Transformation, pp 143-159. Springer LNCS 4407, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Sparud and C. Runciman. Tracing lazy functional computations using redex trails. In Programming Languages: Implementations, Logics and Programs, pages 291–308. Springer LNCS 1292, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Wadler. Why No One Uses Functional Languages. ACM SIGPLAN Notices, 33(8):23–27, 1998. ISSN 0362-1340. doi: 10.1145/286385. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 286387. Functional programming column.Google ScholarGoogle Scholar
  27. M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multiple-view tracing for Haskell: a new Hat. In Proceedings of the 2001 ACM SIGPLAN Haskell Workshop, 2001.Google ScholarGoogle Scholar
  28. A. Zeller. Why Programs Fail, 2nd Edition. Morgan Kaufmann, 2009.Google ScholarGoogle Scholar
  29. T. Zielonka and the GHC Team. http://www.haskell.org/ghc/ survey2005-summary, 2005.Google ScholarGoogle Scholar

Index Terms

  1. Algorithmic debugging of real-world haskell programs: deriving dependencies from the cost centre stack

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 6
      PLDI '15
      June 2015
      630 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2813885
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2015
        630 pages
        ISBN:9781450334686
        DOI:10.1145/2737924

      Copyright © 2015 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 3 June 2015

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader