Abstract
Applicative programming languages have several properties that appear to make debugging difficult. First, the absence of assignment statements complicates the notion of changing a program while debugging. Second, the absence of imperative input and output makes it harder to obtain information about what the program is doing. Third, the presence of lazy evaluation prevents the user from knowing much about the order in which events occur. Some solutions to these problems involve nonapplicative extensions to the language. Fortunately, the same features of applicative languages that cause problems for traditional debugging also support an idiomatic applicative style of programming, and effective debugging techniques can be implemented using that style. This paper shows how to implement tracing and interactive debugging tools in a purely applicative style. This approach is more flexible, extensive and portable than debugging tools that require modification to the language implementation.
Similar content being viewed by others
Abbreviations
- D.1.1[Applicative (Functional) Programming] :
-
Debugging techniques
- D.2.5[Testing and Debugging] :
-
Tracing, Debugging aids
- D.3.2[Language Classifications] :
-
Applicative languages
References
Delisle, N.M., Menicosy, D.E., and Schwartz, M.D. Viewing a programming environment as a single tool. Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, April 1984, pp. 49–56.
Friedman, D.P., and Wise, D.S. CONS should not evaluate its arguments. InAutomata, Languages and Programming S. Michaelson, and R. Milner, (Eds.). Edinburgh Univ. Press, Edinburgh, 1976, pp. 257–284.
Friedman, D.P., and Wise, D.S. Unbounded computational structures.Software Practice and Experience 8 (1976) 407–416.
Friedman, D.P., and Wise, D.S. An indeterminate constructor for applicative programming. Seventh Annual Symposium on Principles of Programming Languages, January 1980, pp. 243–250.
Hall, C.V., and O'Donnell, J.T. Debugging in a side effect free programming environment. Proceedings, 1986 SIGPLAN Symposium on Programming Languages and Programming Environments, June 1985, 60–68.
Hughes, J. Why functional programming matters? Report 16, Programming Methodology Group, Dept. of Computer Science, University of Goteborg, Sweden, Nov. 1984.
Johnson, D. Daisy language manual. Computer Science Department, Indiana University, Bloomington, 1987 (in progress).
Kieburtz, R.B. A proposal for interactive debugging of ML programs. Proceedings of the Workshop on Implementation of Functional Languages, Report 17, Programming Methodology Group, Chalmers University of Technology, Goteborg, Sweden, 1985, pp. 151–155.
Kohlstaedt, A.T. Daisy 1.0 reference manual. Technical Report 116, Computer Science Department, Indiana University, Bloomington, 1981.
Milner, R. How ML evolved.Polymorphism, the ML/LCF/Hope Newsletter L. Cardelli and D. Mac-Queen (Eds.),1, 1 (Jan. 1983) 1–6.
Morris, J.H., Schmidt, E., and Wadler, P. Experience with an applicative string processing language. Conference Record of the Seventh Annual Symposium on Principles of Programming Languages, January 1980, pp. 32–46.
O'Donnell, J.T. Dialogues: A basis for constructing programming environments. Proceedings of the ACM SIGPLAN 85 Symposium on Programming Languages and Programming Environments, June 1985, 19–27.
O'Donnell, J.T. Hardware description with recursion equations.Proceedings of the IFIP 8th International Symposium on Computer Hardware Description Languages and Their Applications. North-Holland, Amsterdam, Apr. 1987, 363–382.
O'Donnell, J.T. An applicative programming environment. Computer Science Dept., Indiana University, Bloomington (in progress).
Peyton Jones, S.L. Directions in functional programming research. InDistributed Computing Systems Programme D.A. Duce, (Ed.). Peter Peregrinus, London, 1984, pp. 221–245.
Shapiro, E.Y.Algorithmic Program Debugging The MIT Press, Cambridge, MA, 1983.
Sterling, L., and Shapiro, E.The Art of Prolog, Advanced Programming Techniques The MIT Press, Cambridge, MA, 1986.
Stoye, W.The Implementation of Functional Languages Using Custom Hardware Computer Laboratory, Cambridge University, Cambridge, Dec. 1985.
Toyn, I., and Runciman, C. Adapting combinator and SECD machines to display snapshots of functional computations.New Generation Computing 4 (1986) 339–363.
Turner, D.A. A new implementation technique for applicative languages.Software—Practice and Experience 9 (1979) 31–49.
Wertz, H. An integrated Lisp programming environment. Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High-Level Debugging, 1983, pp. 91–95.
Wetherell, C.S. Error data values in the data-flow language VAL.ACM Transactions on Programming Languages and Systems 4, 2 (Apr. 1982) 226–238.
Author information
Authors and Affiliations
Additional information
D.2.6[Programming Environments];
Rights and permissions
About this article
Cite this article
O'Donnell, J.T., Hall, C.V. Debugging in applicative languages. Lisp and Symbolic Computation 1, 113–145 (1988). https://doi.org/10.1007/BF01806168
Issue Date:
DOI: https://doi.org/10.1007/BF01806168