Skip to main content

Using MetaML: A Staged Programming Language

  • Conference paper

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

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.

Keywords

  • Partial Evaluation
  • Reduction Rule
  • Elimination Rule
  • Type Constructor
  • Code Pattern

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

This is a preview of subscription content, access via your institution.

Buying options

Chapter
GBP   19.95
Price includes VAT (United Kingdom)
  • DOI: 10.1007/10704973_5
  • Chapter length: 33 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
GBP   47.99
Price includes VAT (United Kingdom)
  • ISBN: 978-3-540-48506-3
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
GBP   59.99
Price includes VAT (United Kingdom)

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)

    MATH  CrossRef  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)

    CrossRef  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)

    CrossRef  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)

    CrossRef  Google Scholar 

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

    MATH  CrossRef  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)

    CrossRef  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)

    CrossRef  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

Affiliations

Authors

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