10.1145/1176617.1176753acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

PyPy's approach to virtual machine construction

Published:22 October 2006Publication History

ABSTRACT

The PyPy project seeks to prove both on a research and a practical level the feasibility of constructing a virtual machine (VM) for a dynamic language in a dynamic language - in this case, Python. The aim is to translate (i.e. compile) the VM to arbitrary target environments, ranging in level from C/Posix to Smalltalk/Squeak via Java and CLI/.NET, while still being of reasonable efficiency within these environments.A key tool to achieve this goal is the systematic reuse of the Python language as a system programming language at various levels of our architecture and translation process. For each level, we design a corresponding type system and apply a generic type inference engine - for example, the garbage collector is written in a style that manipulates simulated pointer and address objects, and when translated to C these operations become C-level pointer and address instructions.

References

  1. B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno virtual machine. IBM Systems Journal, 39(1):211--, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. S. Ananian. The static single information form. Master's thesis, Massachusetts Institute of Technology, September 1999.Google ScholarGoogle Scholar
  3. M. Arnold, S. Fink, D. Grove, M. Hind, and P. F. Sweeney. Architecture and policy for adaptive optimization in virtual machines. Technical Report 23429, IBM Research, November 2004.Google ScholarGoogle Scholar
  4. AT&T. Graphviz - graph visualization software. http://www.graphviz.org/.Google ScholarGoogle Scholar
  5. S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and Water? High Performance Garbage Collection in Java with MMTk. In ICSE, pages 137--146, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. H. Boehm. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.Google ScholarGoogle Scholar
  7. H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Softw. Pract. Exper., 18(9):807--820, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Bracha. Pluggable type systems. In OOPSLA04 Workshop on Revival of Dynamic Languages, October 2004.Google ScholarGoogle Scholar
  9. R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, October 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Damas and R. Milner. Principal type-schemes for functional programs. In POPL '82: Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 207--212, New York, NY, USA, 1982. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Ingalls, T. Kaehler, J. Maloney, S. Wallace, and A. Kay. Back to the future: the story of Squeak, a practical Smalltalk written in itself. In OOPSLA '97: Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 318--326, New York, NY, USA, 1997. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. P-H, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Kelsey. Pre-scheme: A scheme dialect for systems programming.Google ScholarGoogle Scholar
  14. C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO'04), Palo Alto, California, Mar 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Milner. A theory of type polymorphism in programming. J. Comput. Syst. Sci., 17(3):348--375, 1978.Google ScholarGoogle Scholar
  16. PyPy Team. PyPy - Architecture Overview. Web page. http://codespeak.net/pypy/dist/pypy/doc/archi-tecture.html.Google ScholarGoogle Scholar
  17. PyPy Team. PyPy - Translation. Web page, in-progress. http://codespeak.net/pypy/dist/pypy/doc/trans-lation.html.Google ScholarGoogle Scholar
  18. PyPy Team. Complete python implementation running on top of cpython. Technical report, PyPy Consortium, 2005. http://codespeak.net/svn/pypy/extradoc/eu-report/.Google ScholarGoogle Scholar
  19. A. Rigo. Representation-based just-in-time specialization and the psyco prototype for python. In PEPM '04: Proceedings of the 2004 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pages 15--26, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Rigo, M. Hudson, and S. Pedroni. Compiling dynamic language implementations. Technical report, PyPy Consortium, 2005. http://codespeak.net/svn/pypy/extradoc/eu-report/.Google ScholarGoogle Scholar
  21. D. Ungar, A. Spitz, and A. Ausch. Constructing a metacircular virtual machine in an exploratory programming environment. In OOPSLA '05: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 11--20, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. van Rossum et al. CPython 2.4.3, March 2006. http://www.python.org/download/releases/2.4.3/.Google ScholarGoogle Scholar
  23. T. Wang and S. F. Smith. Precise constraint-based type inference for java. In ECOOP '01: Proceedings of the 15th European Conference on Object-Oriented Programming, pages 99--117, London, UK, 2001. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. P. Weicker. Dhrystone benchmark: rationale for version 2 and measurement rules. SIGPLAN Not., 23(8):49--62, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. PyPy's approach to virtual machine construction

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!