Hostname: page-component-848d4c4894-xm8r8 Total loading time: 0 Render date: 2024-06-15T13:50:54.616Z Has data issue: false hasContentIssue false

Staged computation with names and necessity

Published online by Cambridge University Press:  05 August 2005

ALEKSANDAR NANEVSKI
Affiliation:
Carnegie Mellon University, Pittsburgh, PA 15213, USA (email: aleks@cs.cmu.edu, fp@cs.cmu.edu)
FRANK PFENNING
Affiliation:
Carnegie Mellon University, Pittsburgh, PA 15213, USA (email: aleks@cs.cmu.edu, fp@cs.cmu.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Staging is a programming technique for dividing the computation in order to exploit the early availability of some arguments. In the early stages the program uses the available arguments to generate, at run time, the code for the late stages. A type system for staging should ensure that only well-typed expressions are generated, and that only expressions with no free variables are permitted for evaluation. In this paper, we present a calculus for staged computation in which code from the late stages is composed by splicing smaller code fragments into a larger context, possibly incurring capture of free variables. The type system ensures safety by tracking the names of free variables for each code fragment. The type system is based on the necessity operator □ from constructive modal logic, which we index with a set of names C. Our type □CA classifies expressions of type A that belong to the late stage, and whose free names are in the set C.

Type
Article
Copyright
2005 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.