A recursive interpreter for the Icon programming language

  • Authors:
  • J. O'Bagy;R. E. Griswold

  • Affiliations:
  • Department of Computer Science, University of Arizona, Tucson, Arizona;Department of Computer Science, University of Arizona, Tucson, Arizona

  • Venue:
  • SIGPLAN '87 Papers of the Symposium on Interpreters and interpretive techniques
  • Year:
  • 1987

Quantified Score

Hi-index 0.00

Visualization

Abstract

The implementation of the Icon programming language is more interesting and difficult than the implementation of many other programming languages because an expression in Icon can generate a sequence of results. The implementation therefore must support control backtracking in expression evaluation. There also are several novel control structures related to generators. Because expression evaluation is limited lexically, a full coroutine mechanism is not needed and expression evaluation can be handled in a stack-like fashion.The implementation of Icon consists of a virtual machine with a stack-based architecture and an interpreter that executes the virtual machine instructions. There have been several different interpreters for Icon's virtual machine. This paper describes a new approach in which the interpreter is called recursively whenever the context for expression evaluation changes. This recursive interpreter has the advantage of being conceptually clear and flexible without sacrificing efficiency.