Visualizing the Evaluation of Functional Programs for Debugging
Abstract: In this position paper, we present a prototype of a visualizer for functional programs. Such programs, whose evaluation model is the reduction of an expression to a value through repeated application of rewriting rules, and which tend to make little or no use of mutable state, are amenable to visualization in the same fashion as simple mathematical expressions, with which every schoolchild is familiar. We show how such visualizations may be produced for the strict functional language OCaml, by direct interpretation of the abstract syntax tree and appropriate pretty-printing. We describe (and begin to address) the challenges of presenting such program traces in limited space and of identifying their essential elements, so that our methods will one day be practical for more than toy programs. We consider the problems posed by the parts of modern functional programming which are not purely functional such as mutable state, input/output and exceptions. We describe initial work on the use of such visualizations to address the problem of program debugging, which is our ultimate aim.
- A Visual Miranda Machine. Software Education Conference, 1994.
- DrScheme: A Programming Environment for Scheme. Journal of Functional Programming, 2002.
- Andy Gill. Debugging Haskell by Observing Intermediate Data Structures. In Technical Report, University of Nottingham, 2000.
- Doug Goldson. A Symbolic Calculator for Non-Strict Functional Programs. The Computer Journal, 1993.
- Henry Lieberman. The Debugging Scandal and What to Do About it. Communications of the ACM, 1997.
- A Lightweight Interactive Debugger for Haskell. Haskell ’07, pages 13–24, New York, NY, USA, 2007. ACM.
- WinHIPE: An IDE for Functional Programming Based on Rewriting and Visualization. ACM SIGPLAN Notices, 2007.
- Marian Petre and Ed de Quincey. A Gentle Overview of Software Visualization. PPIG Newsletter, September 2006.
- The Calculator Project - Formal Reasoning about Programs. Software Education Conference, 1994.
- Visualization of Exception Handling Constructs to Support Program Understanding. SoftVis ’08, pages 19–28, 2008.
- A review of generic program visualization systems for introductory programming education. Trans. Comput. Educ., 13(4):15:1–15:64, November 2013.
- Jonathan Paul Taylor. Presenting the Lazy Evaluation of Functions. PhD thesis, Queen Mary, University of London, 1996.
- A Debugger for Standard ML. Journal of Functional Programming, 5:155–200, 4 1995.
- David S. Touretzky. Visualizing Evaluation in Applicative Languages. Commun. ACM, 35(10):49–59, October 1989.
- Debugging and the Experience of Immediacy. Communications of the ACM, 1997.
- J. Urquiza-Fuentes and J. Á. Velázquez-Iturbide. A Survey of Program Visualizations for the Functional Paradigm. In Proc. 3rd Program Visualization Workshop, pages 2–9, 2004.
- A Survey of Successful Evaluations of Program Visualisation and Algorithm Animation Systems. 2009.
- Philip Wadler. Why No One Uses Functional Languages. SIGPLAN Not., 33(8):23–27, August 1998.
- Multiple-view tracing for Haskell: a new Hat. In Preliminary Proceedings of the 2001 ACM SIGPLAN Haskell Workshop, Firenze, Italy, pages 151–170, 2001.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.