Skip to main content

From Stack Traces to Lazy Rewriting Sequences

  • Conference paper
Implementation and Application of Functional Languages (IFL 2011)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7257))

Abstract

Reasoning about misbehaving lazy functional programs can be confusing, particularly for novice programmers. Unfortunately, the complicated nature of laziness also renders most debugging tools ineffective at clarifying this confusion. In this paper, we introduce a new lazy debugging tool for novice programmers, an algebraic stepper that presents computation as a sequence of parallel rewriting steps. Parallel program rewriting represents sharing accurately and enables debugging at the level of source syntax, minimizing the presentation of low-level details or the effects of distorting transformations that are typical for other lazy debuggers. Semantically, our rewriting system represents a compromise between Launchbury’s store-based semantics and an axiomatic description of lazy computation as sharing-via-parameters. Finally, we prove the correctness of our tool by showing that the stepper’s run-time machinery reconstructs the expected lazy rewriting sequence.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Allwood, T.O., Peyton Jones, S., Eisenbach, S.: Finding the needle: stack traces for GHC. In: Proc. 2nd Symp. on Haskell, pp. 129–140 (2009)

    Google Scholar 

  2. Ariola, Z.M., Felleisen, M., Maraist, J., Odersky, M., Wadler, P.: The call-by-need λ calculus. In: Proc. 22nd POPL, pp. 233–246 (1995)

    Google Scholar 

  3. Augustson, M., Reinfelds, J.: A visual miranda machine. In: Proc. Software Education Conference SRIG-ET, pp. 233–246 (1995)

    Google Scholar 

  4. Chitil, O., Luo, Y.: Structure and properties of traces for functional programs. In: Proc. 3rd Intl. Works. Term Graph Rewriting, pp. 39–63 (2006)

    Google Scholar 

  5. Clements, J.: Portable and High-level Access to the Stack with Continuation Marks. Ph.D. thesis, Northeastern University (2006)

    Google Scholar 

  6. Clements, J., Flatt, M., Felleisen, M.: Modeling an Algebraic Stepper. In: Sands, D. (ed.) ESOP 2001. LNCS, vol. 2028, pp. 320–334. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  7. Ennals, R., Peyton Jones, S.: HsDebug: debugging lazy programs by not being lazy. In: Proc. Works. on Haskell, pp. 84–87 (2003)

    Google Scholar 

  8. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press (2009)

    Google Scholar 

  9. Felleisen, M., Friedman, D.P.: A syntactic theory of sequential state. Theor. Comput. Sci. 69(3), 243–287 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  10. Foubister, S.P.: Graphical Application and Visualisation of Lazy Functional Computation. Ph.D. thesis, University of York (1995)

    Google Scholar 

  11. Gibbons, J., Wansbrough, K.: Tracing lazy functional languages. In: Proc. CATS, pp. 11–20 (1996)

    Google Scholar 

  12. Goldson, D.: A symbolic calculator for non-strict functional languages. Comput. J. 37(3), 177–187 (1994)

    Article  Google Scholar 

  13. Hughes, J.: Why functional programming matters. Comput. J. 32(2), 98–107 (1989)

    Article  Google Scholar 

  14. Keller, R.: Formal verification of parallel programs. Commun. ACM 19(7) (1976)

    Google Scholar 

  15. Kishon, A.: Theory and Art of Semantics-Directed Program Execution Monitoring. Ph.D. thesis, Yale University (1992)

    Google Scholar 

  16. Lapalme, G., Latendresse, M.: A debugging environment for lazy functional languages. LISP and Symbolic Computation 5(3), 271–287 (1992)

    Article  Google Scholar 

  17. Marlow, S., Iborra, J., Pope, B., Gill, A.: A lightweight interactive debugger for Haskell. In: Proc. Works. on Haskell, pp. 13–24 (2007)

    Google Scholar 

  18. Naish, L.: Declarative debugging of lazy functional programs. In: Proc. 16th ACSC (1993)

    Google Scholar 

  19. Nilsson, H., Fritzson, P.: Algorithmic debugging for lazy functional languages. In: Proc. 4th PLIPL, pp. 385–399 (1992)

    Google Scholar 

  20. O’Donnell, J.T., Hall, C.V.: Debugging in applicative languages. LISP and Symbolic Computation 1(2), 113–145 (1988)

    Article  MATH  Google Scholar 

  21. Patel, M.J., du Boulay, B., Taylor, C.: Effect of format on information and problem solving. In: Proc. 13th Conf. of the Cognitive Science Society, pp. 852–856 (1991)

    Google Scholar 

  22. Penney, A.: Augmenting Trace-based Functional Debugging. Ph.D. thesis, University of Bristol, Australia (1999)

    Google Scholar 

  23. Snyder, R.M.: Lazy debugging of lazy functional programs. New Generation Computing 8, 139–161 (1990)

    Article  Google Scholar 

  24. Sparud, J., Runciman, C.: Tracing lazy functional computations using redex trails. In: Proc. 9th PLILP, pp. 291–308 (1997)

    Google Scholar 

  25. Taylor, J.P.: Presenting the Lazy Evaluation of Functions. Ph.D. thesis, Queen Mary and Westfield College (1996)

    Google Scholar 

  26. Wallace, M., Chitil, O., Brehm, T., Runciman, C.: Multiple-view tracing for Haskell: a new hat. In: Proc. Works. on Haskell, pp. 151–170 (2001)

    Google Scholar 

  27. Watson, R.D.: Tracing Lazy Evaluation by Program Transformation. Ph.D. thesis, Southern Cross University, Australia (1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chang, S., Barzilay, E., Clements, J., Felleisen, M. (2012). From Stack Traces to Lazy Rewriting Sequences. In: Gill, A., Hage, J. (eds) Implementation and Application of Functional Languages. IFL 2011. Lecture Notes in Computer Science, vol 7257. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34407-7_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34407-7_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34406-0

  • Online ISBN: 978-3-642-34407-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics