A Tail-Recursive Semantics for Stack Inspections

  • John Clements
  • Matthias Felleisen
Conference paper

DOI: 10.1007/3-540-36575-3_3

Part of the Lecture Notes in Computer Science book series (LNCS, volume 2618)
Cite this paper as:
Clements J., Felleisen M. (2003) A Tail-Recursive Semantics for Stack Inspections. In: Degano P. (eds) Programming Languages and Systems. ESOP 2003. Lecture Notes in Computer Science, vol 2618. Springer, Berlin, Heidelberg


Security folklore holds that a security mechanism based on stack inspection is incompatible with a global tail call optimization policy. An implementation of such a language may have to allocate memory for a source-code tail call, and a program that uses only tail calls (and no other memory-allocating construct) may nevertheless exhaust the available memory. In this paper, we prove this widely held belief wrong. We exhibit an abstract machine for a language with security stack inspection whose space consumption function is equivalent to that of the canonical tail call optimizing abstract machine. Our machine is surprisingly simple and suggests that tail-calls are as easy to implement in a security setting as they are in a conventional one.

Download to read the full conference paper text

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • John Clements
    • 1
  • Matthias Felleisen
    • 1
  1. 1.Northeastern UniversityBostonMassachusetts

Personalised recommendations