Skip to main content

Using MetaML: A Staged Programming Language

  • Conference paper
Advanced Functional Programming (AFP 1998)

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

Included in the following conference series:

Abstract

The purpose of staged programming in general, and MetaML in particular, is to produce efficient programs. We wish to move beyond programs that compute the “correct” output, to those that also have better control over resources (both space and time). The mechanism for doing this is to use program annotations to control the order of evaluation of terms. It should come as no surprise to those who have studied the λ-calculus that the number of steps in a reduction is strongly influenced by the order of evaluation. Since the number of steps in a reduction relates strongly to the resources it consumes, controlling evaluation order gives programmers better control over resources consumed. MetaML allows programmers to move beyond a fixed evaluation strategy, and to specify precisely the desired evaluation order.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Consel, C., Danvy, O.: Tutorial notes on partial evaluation. In: 20th ACM Symposium on Principles of Programming Languages, pp. 493–501 (January 1993)

    Google Scholar 

  2. Dershowitz, N.: Computing with rewrite systems. Information and Control 65, 122–157 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  3. Jones, M.P.: A system of constructor classes: Overloading and implicit higherorder polumorphism. In: FPCA 1993: Conference on Functional Programming Lan- guages and Computer Architecture, Copenhagen, Denmark, pp. 52–61. ACM Press, New York (1993)

    Chapter  Google Scholar 

  4. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. In: Hoare, C.A.R. (ed.). International Series in Computer Science, Prentice Hall International, Englewood Cliffs (June 1993). ISBN number 0-13-020249-5 (pbk)

    Google Scholar 

  5. Launchbury, J., Peyton-Jones, S.: Lazy functional state threads. In: PLDI 1994: Programming Language Design and Implementation, Orlando, Florida, pp. 24–35. ACM Press, New York (1994)

    Chapter  Google Scholar 

  6. Martel, M., Sheard, T.: Introduction to multi-stage programming using metaml. Technical report, OGI, Portland, OR (September 1997)

    Google Scholar 

  7. Odersky, M., Läufer, K.: Putting type annotations to work. In: Proc. 23rd ACM Symposium on Principles of Programming Languages, pp. 54–67 (January 1996)

    Google Scholar 

  8. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)

    Book  Google Scholar 

  9. Plotkin, G.D.: Call-by-name, call-by-value- and the lambda-calculus. Theoretical Computer Science 1, 125–159 (1975)

    Article  MATH  MathSciNet  Google Scholar 

  10. Sabry, A., Wadler, P.: A reflection on a call-by-value. ACM Transactions on Programming Languages and Systems 19(6), 916–941 (1997)

    Article  Google Scholar 

  11. Taha, W., el-abidine Benaissa, Z., Sheard, T.: The essence of staged programming. Technical report, OGI, Portland, OR, 236 (December 1997)

    Google Scholar 

  12. Taha, W., Sheard, T.: Multi-stage programming with explicit annotations. In: Proceedings of the ACM-SIGPLAN Symposium on Partial Evaluation and semantic based program manipulations PEPM 1997, pp. 203–217. ACM, New York (1997)

    Chapter  Google Scholar 

  13. Taha, W., Sheard, T.: Metaml: Multi-stage programming with explicit annotations. Theoretical Computer Science, To Appear. 236

    Google Scholar 

  14. Wadler, P.: Comprehending monads. In: Proceedings of the ACM Symposium on Lisp and Functional Programming, Nice, France, pp. 61–78 (June 1990)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sheard, T. (1999). Using MetaML: A Staged Programming Language. In: Swierstra, S.D., Oliveira, J.N., Henriques, P.R. (eds) Advanced Functional Programming. AFP 1998. Lecture Notes in Computer Science, vol 1608. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10704973_5

Download citation

  • DOI: https://doi.org/10.1007/10704973_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66241-9

  • Online ISBN: 978-3-540-48506-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics