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
- 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 Scholar
Digital Library
- C. S. Ananian. The static single information form. Master's thesis, Massachusetts Institute of Technology, September 1999.Google Scholar
- 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 Scholar
- AT&T. Graphviz - graph visualization software. http://www.graphviz.org/.Google Scholar
- 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 Scholar
Digital Library
- H. Boehm. A garbage collector for C and C++. http://www.hpl.hp.com/personal/Hans_Boehm/gc/.Google Scholar
- H.-J. Boehm and M. Weiser. Garbage collection in an uncooperative environment. Softw. Pract. Exper., 18(9):807--820, 1988. Google Scholar
Digital Library
- G. Bracha. Pluggable type systems. In OOPSLA04 Workshop on Revival of Dynamic Languages, October 2004.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- N. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. P-H, 1993. Google Scholar
Digital Library
- R. Kelsey. Pre-scheme: A scheme dialect for systems programming.Google Scholar
- 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 Scholar
Digital Library
- R. Milner. A theory of type polymorphism in programming. J. Comput. Syst. Sci., 17(3):348--375, 1978.Google Scholar
- PyPy Team. PyPy - Architecture Overview. Web page. http://codespeak.net/pypy/dist/pypy/doc/archi-tecture.html.Google Scholar
- PyPy Team. PyPy - Translation. Web page, in-progress. http://codespeak.net/pypy/dist/pypy/doc/trans-lation.html.Google Scholar
- PyPy Team. Complete python implementation running on top of cpython. Technical report, PyPy Consortium, 2005. http://codespeak.net/svn/pypy/extradoc/eu-report/.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- G. van Rossum et al. CPython 2.4.3, March 2006. http://www.python.org/download/releases/2.4.3/.Google Scholar
- 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 Scholar
Digital Library
- R. P. Weicker. Dhrystone benchmark: rationale for version 2 and measurement rules. SIGPLAN Not., 23(8):49--62, 1988. Google Scholar
Digital Library
Index Terms
PyPy's approach to virtual machine construction




Comments