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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Ariola, Z.M., Felleisen, M., Maraist, J., Odersky, M., Wadler, P.: The call-by-need λ calculus. In: Proc. 22nd POPL, pp. 233–246 (1995)
Augustson, M., Reinfelds, J.: A visual miranda machine. In: Proc. Software Education Conference SRIG-ET, pp. 233–246 (1995)
Chitil, O., Luo, Y.: Structure and properties of traces for functional programs. In: Proc. 3rd Intl. Works. Term Graph Rewriting, pp. 39–63 (2006)
Clements, J.: Portable and High-level Access to the Stack with Continuation Marks. Ph.D. thesis, Northeastern University (2006)
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)
Ennals, R., Peyton Jones, S.: HsDebug: debugging lazy programs by not being lazy. In: Proc. Works. on Haskell, pp. 84–87 (2003)
Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press (2009)
Felleisen, M., Friedman, D.P.: A syntactic theory of sequential state. Theor. Comput. Sci. 69(3), 243–287 (1989)
Foubister, S.P.: Graphical Application and Visualisation of Lazy Functional Computation. Ph.D. thesis, University of York (1995)
Gibbons, J., Wansbrough, K.: Tracing lazy functional languages. In: Proc. CATS, pp. 11–20 (1996)
Goldson, D.: A symbolic calculator for non-strict functional languages. Comput. J. 37(3), 177–187 (1994)
Hughes, J.: Why functional programming matters. Comput. J. 32(2), 98–107 (1989)
Keller, R.: Formal verification of parallel programs. Commun. ACM 19(7) (1976)
Kishon, A.: Theory and Art of Semantics-Directed Program Execution Monitoring. Ph.D. thesis, Yale University (1992)
Lapalme, G., Latendresse, M.: A debugging environment for lazy functional languages. LISP and Symbolic Computation 5(3), 271–287 (1992)
Marlow, S., Iborra, J., Pope, B., Gill, A.: A lightweight interactive debugger for Haskell. In: Proc. Works. on Haskell, pp. 13–24 (2007)
Naish, L.: Declarative debugging of lazy functional programs. In: Proc. 16th ACSC (1993)
Nilsson, H., Fritzson, P.: Algorithmic debugging for lazy functional languages. In: Proc. 4th PLIPL, pp. 385–399 (1992)
O’Donnell, J.T., Hall, C.V.: Debugging in applicative languages. LISP and Symbolic Computation 1(2), 113–145 (1988)
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)
Penney, A.: Augmenting Trace-based Functional Debugging. Ph.D. thesis, University of Bristol, Australia (1999)
Snyder, R.M.: Lazy debugging of lazy functional programs. New Generation Computing 8, 139–161 (1990)
Sparud, J., Runciman, C.: Tracing lazy functional computations using redex trails. In: Proc. 9th PLILP, pp. 291–308 (1997)
Taylor, J.P.: Presenting the Lazy Evaluation of Functions. Ph.D. thesis, Queen Mary and Westfield College (1996)
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)
Watson, R.D.: Tracing Lazy Evaluation by Program Transformation. Ph.D. thesis, Southern Cross University, Australia (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)