Type-specialized staged programming with process separation

  • Authors:
  • Yu David Liu;Christian Skalka;Scott F. Smith

  • Affiliations:
  • SUNY, Binghamton, USA;The University of Vermont, Burlington, USA;The Johns Hopkins University, Baltimore, USA

  • Venue:
  • Higher-Order and Symbolic Computation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Staging is a powerful language construct that allows a program at one stage of evaluation to manipulate and specialize a program to be executed at a later stage. We propose a new staged language calculus, 驴ML驴, which extends the programmability of staged languages in two directions. First, 驴ML驴 supports dynamic type specialization: types can be dynamically constructed, abstracted, and passed as arguments, while preserving decidable typechecking via a System F驴-style semantics combined with a restricted form of 驴 驴 -style runtime type construction. With dynamic type specialization the data structure layout of a program can be optimized via staging. Second, 驴ML驴 works in a context where different stages of computation are executed in different process spaces, a property we term staged process separation. Programs at different stages can directly communicate program data in 驴ML驴 via a built-in serialization discipline. The language 驴ML驴 is endowed with a metatheory including type preservation, type safety, and decidability as demonstrated constructively by a sound type checking algorithm. While our language design is general, we are particularly interested in future applications of staging in resource-constrained and embedded systems: these systems have limited space for code and data, as well as limited CPU time, and specializing code for the particular deployment at hand can improve efficiency in all of these dimensions. The combination of dynamic type specialization and staging across processes greatly increases the utility of staged programming in these domains. We illustrate this via wireless sensor network programming examples.