Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.5555/1784774.1784795guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Deriving compilers and virtual machines for a multi-level language

Published: 29 November 2007 Publication History

Abstract

We develop virtual machines and compilers for a multi-level language, which supports multi-stage specialization by composing program fragments with quotation mechanisms. We consider two styles of virtual machines--ones equipped with special instructions for code generation and ones without--and show that the latter kind can deal with, more easily, low-level code generation, which avoids the overhead of (run-time) compilation by manipulating instruction sequences, rather than source-level terms, as data. The virtual machines and accompanying compilers are derived by program transformation, which extends Ager et al.'s derivation of virtual machines from evaluators.

References

[1]
Nielson, F., Nielson, H.R.: Two-Level Functional Languages. Cambridge University Press, Cambridge (1992).
[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).
[3]
Davies, R.: A temporal-logic approach to binding-time analysis. In: Proc. of IEEE LICS, pp. 184-195 (July 1996).
[4]
Wickline, P., Lee, P., Pfenning, F.: Run-time code generation and Modal-ML. In: Proc. of ACM PLDI, pp. 224-235 (1998).
[5]
Taha, W., Benaissa, Z.E.A., Sheard, T.: Multi-stage programming: Axiomatization and type-safety. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, pp. 918-929. Springer, Heidelberg (1998).
[6]
Moggi, E., Taha, W., Benaissa, Z.E.A., Sheard, T.: An idealized MetaML: Simpler, and more expressive. In: Swierstra, S.D. (ed.) ESOP 1999 and ETAPS 1999. LNCS, vol. 1576, pp. 193-207. Springer, Heidelberg (1999).
[7]
Taha, W., Sheard, T.: MetaML and multi-stage programming with explicit annotations. Theoretical Computer Science 248, 211-242 (2000).
[8]
Davies, R., Pfenning, F.: A modal analysis of staged computation. Journal of the ACM 48(3), 555-604 (2001).
[9]
Taha, W., Nielsen, M.F.: Environment classifiers. In: Proc. of ACM POPL, pp. 26-37 (2003).
[10]
Calcagno, C., Moggi, E., Taha, W.: ML-like inference for classifiers. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 79-93. Springer, Heidelberg (2004).
[11]
Yuse, Y., Igarashi, A.: A modal type system for multi-level generating extensions with persistent code. In: Proc. of ACM PPDP, pp. 201-212. ACM Press, New York (2006).
[12]
Poletto, M., Hsieh, W.C., Engler, D.R., Kaashoek, M.F.: 'C and tcc: A language and compiler for dynamic code generation. ACM Transactions on Programming Languages and Systems 21(2), 324-369 (1999).
[13]
Masuhara, H., Yonezawa, A.: Run-time bytecode specialization: A portable approach to generating optimized specialized code. In: Danvy, O., Filinski, A. (eds.) PADO 2001. LNCS, vol. 2053, pp. 138-154. Springer, Heidelberg (2001).
[14]
Consel, C., Lawall, J.L., Meur, A.F.L.: A tour of Tempo: A program specializer for the C language. Science of Computer Programming 52(1-3), 341-370 (2004).
[15]
Grant, B., Mock, M., Philipose, M., Chambers, C., Eggers, S.J.: DyC: An expressive annotation-directed dynamic compiler for C. Theoretical Computer Science 248(1- 2), 147-199 (2000).
[16]
Cousineau, G., Curien, P.L., Mauny, M.: The categorical abstract machine. Science of Computer Programming 8(2), 173-202 (1987).
[17]
Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: From interpreter to compiler and virtual machine: A functional derivation. Technical Report RS-03-14, BRICS (March 2003).
[18]
Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. In: Proc. of ACM PPDP, pp. 8-19 (2003).
[19]
Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. In: Proc. of ACM ICFP, pp. 235-246 (2002).
[20]
Kohlbecker, E., Friedman, D.P., Felleisen, M., Duba, B.: Hygienic macro expansion. In: Proc. of ACM LFP, pp. 151-161 (1986).
[21]
Reynolds, J.C.: Definitional interpreters for higher-order programming languages. Higher-Order Symbolic Computation 11(4), 363-397 (1998).
[22]
Felleisen, M., Friedman, D.P.: Control operators, the SECD machine, and the λ-calculus. In: Proc. Formal Description of Prog. Concepts III, pp. 193-217 (1986).
[23]
Calcagno, C., Taha, W., Huang, L., Leroy, X.: Implementing multi-stage languages using ASTs, gensym, and reflection. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 57-76. Springer, Heidelberg (2003).
[24]
Leone, M., Lee, P.: Optimizing ML with run-time code generation. In: Proc. of ACM PLDI, pp. 137-148 (1996).
[25]
Marlet, R., Consel, C., Boinot, P.: Efficient incremental run-time specialization for free. In: Proc. of ACM PLDI, pp. 281-292 (1999).
[26]
Consel, C., Noël, F.: A general approach for run-time specialization and its application to C. In: Proc. of ACM POPL, pp. 145-156 (1996).
[27]
Krivine, J.L.: A call-by-name lambda-calculus machine. Available online, from http://www.pps.jussieu.fr/~krivine
[28]
Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between call-by-need evaluators and lazy abstract machines. Information Processing Letters 90(5), 223-232 (2004).
[29]
Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between monadic evaluators and abstract machines for languages with computational effects. Theoretical Computer Science 342(1), 149-172 (2005).
[30]
Leroy, X.: The ZINC experiment: An economical implementation of the ML language. Technical Report 117, INRIA (1990).

Cited By

View all
  • (2010)Functional derivation of a virtual machine for delimited continuationsProceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming10.1145/1836089.1836101(87-98)Online publication date: 26-Jul-2010

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
APLAS'07: Proceedings of the 5th Asian conference on Programming languages and systems
November 2007
431 pages
ISBN:3540766367
  • Editor:
  • Zhong Shao

Sponsors

  • AAFS: Asian Association for Foundation of Software
  • Natl University of Singapore: National University of Singapore

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 29 November 2007

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 02 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2010)Functional derivation of a virtual machine for delimited continuationsProceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming10.1145/1836089.1836101(87-98)Online publication date: 26-Jul-2010

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media