Skip to main content

On Stage Ordering in Staged Computation

  • Conference paper
  • 468 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2830))

Abstract

A staged computation is a computation organized in a cascade of stages: each stage produces code for its successive stage; the final stage produces the desired output. An off-line procedure called binding time analysis (BTA) is often used to pre-convert unstaged code into staged code, i.e., code annotated with stage labels, which can guide online staged computation. For dynamic re-optimization purposes, it is advantageous for the order of stages in the cascade to change during runtime; however, the staged code may not support all permutations of stage sequences. Thus, it is both a and practical question to efficiently decide whether a specific stage sequence is valid for a staged code.

Our approach is to encode the set of valid stage sequences for a staged code off-line in a stage ordering language (SOL) to facilitate fast online decision. Contrary to the intuition that we only need a single generic SOL (such as the language of posets of stage labels) to sufficiently and efficiently encode the set of valid stage sequences for any staged code in any staged language, we may need different SOLs for different staged languages. We analyze several staged languages and then present a metatheory on validating a SOL for a given staged language. Our result reveals the relationship between SOLs and semantic properties of staged languages, and can influence the design of staged languages and BTA.

This material is based upon work supported by the National Science Foundation under Grant Nos. 0086116, 0085773, and 9817773.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Consel, C., Noël, F.: A general approach for run-time specialization and its application to C. In: Proc. of the 23th ACM Symposium on Principles of Programming Languages, pp. 145–156 (1996)

    Google Scholar 

  2. Glück, R., Jørgensen, J.: Efficient multi-level generating extensions for program specialization. In: Swierstra, S.D. (ed.) PLILP 1995. LNCS, vol. 982, pp. 259–278. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  3. Grant, B., Mock, M., Philipose, M., Chambers, C., Eggers, S.: DyC: An expressive annotation-directed dynamic compiler for C. Theoretical Computer Science 248(1- 2), 147–199 (2000)

    Article  MATH  Google Scholar 

  4. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall International, Englewood Cliffs (1993)

    Google Scholar 

  5. Lee, P., Leone, M.: Optimizing ML with run-time code generation. In: Proc. of Programming Language Design and Implementation Conf., pp. 137–148 (1996)

    Google Scholar 

  6. Nielson, F., Nielson, H.R.: Two-Level Functional Languages. Cambridge University Press, Cambridge (1992)

    Book  MATH  Google Scholar 

  7. Nielson, F., Nielson, H.R.: Multi-level lambda-calculi: an algebraic description. LNCS, pp. 338–354. Springer, Heidelberg (1996)

    Google Scholar 

  8. Nielson, F., Nielson, H.R.: A prescriptive framework for designing multi-level lambda-calculi. In: Proc. of the 1997 ACM Symposium on Partial Evaluation and Semantics-based Program Manipulation, pp. 193–202 (June 1997)

    Google Scholar 

  9. Taha, W.: Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology (November 1999)

    Google Scholar 

  10. Taha, W., Sheard, T.: Multi-stage programming with explicit annotations. In: Proc. of the 1997 ACM Symposium on Partial Evaluation and Semantics-based Program Manipulation, pp. 203–217 (June 1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wang, Z., Muntz, R.R. (2003). On Stage Ordering in Staged Computation. In: Pfenning, F., Smaragdakis, Y. (eds) Generative Programming and Component Engineering. GPCE 2003. Lecture Notes in Computer Science, vol 2830. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39815-8_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-39815-8_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20102-1

  • Online ISBN: 978-3-540-39815-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics