Using MetaML: A Staged Programming Language
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.
KeywordsPartial Evaluation Reduction Rule Elimination Rule Type Constructor Code Pattern
Unable to display preview. Download preview PDF.
- 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
- 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
- 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
- 11.Taha, W., el-abidine Benaissa, Z., Sheard, T.: The essence of staged programming. Technical report, OGI, Portland, OR, 236 (December 1997)Google Scholar
- 13.Taha, W., Sheard, T.: Metaml: Multi-stage programming with explicit annotations. Theoretical Computer Science, To Appear. 236Google 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