Nothing Special   »   [go: up one dir, main page]

Skip to main content

Constructing Customized Interpreters from Reusable Evaluators Using Game

  • Conference paper
Software Composition (SC 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7306))

Included in the following conference series:

Abstract

Separation of concerns is difficult to achieve in the implementation of a programming language interpreter. We argue that evaluator concerns (i.e., those implementing the operational semantics of the language) are, in particular, difficult to separate from the runtime concerns (e.g., memory and stack management) that support them. This precludes the former from being reused and limits variability in the latter.

In this paper, we present the Game environment for composing customized interpreters from a reusable evaluator and different variants of its supporting runtime. To this end, Game offers a language for specifying the evaluator according to the generic programming methodology. Through a transformation into defunctionalized monadic style, the Game toolchain generates a generic abstract machine in which the sequencing of low-level interpretational steps is parameterized. Given a suitable instantiation of these parameters for a particular runtime, the toolchain is able to inject the runtime into the generic abstract machine such that a complete interpreter is generated.

To validate our approach, we port the prototypical Scheme evaluator to Game and compose the resulting generic abstract machine with several runtimes that vary in their automatic memory management as well as their stack discipline.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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.

Similar content being viewed by others

References

  1. Abelson, H., Sussman, G.J., Sussman, J.: Structure and Interpretation of Computer Programs, 2nd edn. MIT Press/McGraw-Hill, Cambridge (1996)

    MATH  Google Scholar 

  2. Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. In: Proc. of the 5th ACM SIGPLAN Intl. Conf. on Principles and Practice of Declaritive Programming, PPDP 2003, pp. 8–19. ACM, New York (2003)

    Google Scholar 

  3. Clinger, W.D., Hartheimer, A.H., Ost, E.M.: Implementation strategies for first-class continuations. Higher Order Symbol. Comput. 12, 7–45 (1999)

    Article  MATH  Google Scholar 

  4. Danvy, O.: Defunctionalized interpreters for programming languages. In: Proc. of the 13th ACM SIGPLAN Intl. Conf. on Functional Programming, ICFP 2008, pp. 131–142. ACM, New York (2008)

    Chapter  Google Scholar 

  5. Diehl, S., Sestoft, P.: Abstract machines for programming language implementation. Future Gener. Comput. Syst. 16, 739–751 (2000)

    Article  Google Scholar 

  6. Anton Ertl, M., Gregg, D.: The structure and performance of efficient interpreters. Journal of Instruction-Level Parallelism 5, 1–25 (2003)

    Google Scholar 

  7. Ganz, S.E., Friedman, D.P., Wand, M.: Trampolined style. In: Proc. of the Fourth ACM SIGPLAN Intl. Conf. on Functional Programming, ICFP 1999, pp. 18–27. ACM, New York (1999)

    Chapter  Google Scholar 

  8. Graunke, P., Findler, R.B., Krishnamurthi, S., Felleisen, M.: Automatically restructuring programs for the web. In: Proc. of the 16th IEEE Intl. Conf. on Automated Software Engineering, ASE 2001, p. 211. IEEE Computer Society, Washington, DC (2001)

    Chapter  Google Scholar 

  9. Hanson, C.: Efficient stack allocation for tail-recursive languages. In: Proc. of the 1990 ACM Conf. on LISP and Functional Programming, LFP 1990, pp. 106–118. ACM, New York (1990)

    Chapter  Google Scholar 

  10. Herzeel, C., Costanza, P.: Dynamic parallelization of recursive code: part 1: managing control flow interactions with the continuator. In: Proc. of the ACM Intl. Conf. on Object Oriented Programming Systems Languages and Applications, OOPSLA 2010, pp. 377–396. ACM, New York (2010)

    Chapter  Google Scholar 

  11. Liang, S., Hudak, P., Jones, M.: Monad transformers and modular interpreters. In: Proc. of the 22nd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 1995, pp. 333–343. ACM, New York (1995)

    Chapter  Google Scholar 

  12. Nielsen, L.R.: A selective cps transformation. Electr. Notes Theor. Comput. Sci. 45, 311–331 (2001)

    Article  Google Scholar 

  13. Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proc. of the ACM Annual Conf., ACM 1972, vol. 2, pp. 717–740. ACM, New York (1972)

    Chapter  Google Scholar 

  14. Rigo, A., Pedroni, S.: Pypy’s approach to virtual machine construction. In: Companion to the 21st ACM SIGPLAN Symp. on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2006, pp. 944–953. ACM, New York (2006)

    Chapter  Google Scholar 

  15. Rompf, T., Maier, I., Odersky, M.: Implementing first-class polymorphic delimited continuations by a type-directed selective cps-transform. In: Proc. of the 14th ACM SIGPLAN Intl. Conf. on Functional Programming, ICFP 2009, pp. 317–328. ACM, New York (2009)

    Chapter  Google Scholar 

  16. Schrijvers, T., Peyton Jones, S., Chakravarty, M., Sulzmann, M.: Type checking with open type functions. In: Proc. of the 13th ACM SIGPLAN Intl. Conf. on Functional Programming, ICFP 2008, pp. 51–62. ACM, New York (2008)

    Chapter  Google Scholar 

  17. Snyder, M., Frisby, N., Kimmell, G., Alexander, P.: Writing Composable Software with InterpreterLib. In: Bergel, A., Fabry, J. (eds.) SC 2009. LNCS, vol. 5634, pp. 160–176. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  18. Talpin, J.-P., Jouvelot, P.: The type and effect discipline. Inf. Comput. 111, 245–296 (1994)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Timbermont, S., De Roover, C., D’Hondt, T. (2012). Constructing Customized Interpreters from Reusable Evaluators Using Game . In: Gschwind, T., De Paoli, F., Gruhn, V., Book, M. (eds) Software Composition. SC 2012. Lecture Notes in Computer Science, vol 7306. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30564-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-30564-1_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-30563-4

  • Online ISBN: 978-3-642-30564-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics