@TECHREPORT{Kelsey92tail-recursivestack, author = {Richard Kelsey}, title = {Tail-Recursive Stack Disciplines for an Interpreter}, institution = {}, year = {1992} }
Bookmark
OpenURL
Abstract
Many languages, including Scheme, ML, and Haskell, require that their implementations support tail-recursive calls to arbitrary depth. This requirement means that a traditional stack discipline cannot be used for these languages. This paper examines several different methods of implementing proper tail recursion in a stack-based interpeter, including passing arguments in a heap, copying arguments to tail-recursive calls, and garbage collecting the stack. Benchmark timings and other run-time statistics are used to compare the different methods. The results show that using a stack is a good idea, and that the overhead of the interpreter largely overshadows the differences in performance of the various stack disciplines. This is a slightly enhanced version of Technical Report NU-CCS-93-03, College of Computer Science, Northeastern University, 1992. 1 The Problem A programming language implementation is properly tail recursive if unbounded iterative computations that are expressed recursi...