Type-specialized staged programming with process separation
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〉 supp...
Saved in:
| Published in: | Higher-Order and Symbolic Computation Vol. 24; no. 4; pp. 341 - 385 |
|---|---|
| Main Authors: | , , |
| Format: | Journal Article |
| Language: | English |
| Published: |
Boston
Springer US
01.11.2011
Springer |
| Subjects: | |
| ISSN: | 1388-3690, 1573-0557 |
| Online Access: | Get full text |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| Summary: | 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. |
|---|---|
| ISSN: | 1388-3690 1573-0557 |
| DOI: | 10.1007/s10990-012-9089-0 |