Representation-based just-in-time specialization and the psyco prototype for python

A powerful application of specialization is to remove interpretative overhead: a language can be implemented with an interpreter, whose performance is then improved by specializing it for a given program source. This approach is only moderately successful with very high level languages, where the operation of each single step can be highly dependent on run-time data and context. In the present paper, the Psyco prototype for the Python language is presented. It introduces two novel techniques. The first is just-in-time specialization, or specialization by need, which introduces the "unlifting" ability for a value to be promoted from run-time to compile-time during specialization -- the inverse of the lift operator of partial evaluation. Its presence gives an unusual and powerful perspective on the specialization process. The second technique is representations, a theory of data-oriented specialization generalizing the traditional specialization domains (i.e. the compile-time/run-time dichotomy).

[1]  Urs Hölzle,et al.  Reconciling responsiveness with performance in pure object-oriented languages , 1996, TOPL.

[2]  Anders Haraldsson A program manipulation system based on partial evaluation , 1977 .

[3]  Michael Salib,et al.  Starkiller: A Static Type Inferencer and Compiler for Python , 2004 .

[4]  Calton Pu,et al.  The Synthesis Kernel , 1988, Comput. Syst..

[5]  Chris Lattner,et al.  LLVM: AN INFRASTRUCTURE FOR MULTI-STAGE OPTIMIZATION , 2000 .

[6]  Peter Lee,et al.  Optimizing ML with run-time code generation , 1996, PLDI '96.

[7]  Crispin Cowan,et al.  Declarative specialization of object-oriented programs , 1997, OOPSLA '97.

[8]  John Maloney,et al.  Back to the Future The Story of Squeak, A Practical Smalltalk Written in Itself , 1997 .

[9]  John Aycock,et al.  A brief history of just-in-time , 2003, CSUR.

[10]  Siau-Cheng Khoo,et al.  Parameterized partial evaluation , 1993, TOPL.

[11]  G. vanRossum Python reference manual , 1995 .

[12]  Satoshi Matsuoka,et al.  Compiling away the meta-level in object-oriented concurrent reflective languages using partial evaluation , 1995, OOPSLA.

[13]  John Whaley Partial method compilation using dynamic profile information , 2001, OOPSLA '01.

[14]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[15]  Guido Rossum,et al.  Python Reference Manual , 2000 .

[16]  Craig Chambers,et al.  The design and implementation of the self compiler, an optimizing compiler for object-oriented programming languages , 1992 .

[17]  Craig Chambers,et al.  Staged compilation , 2002, PEPM '02.

[18]  David Grove,et al.  Selective specialization for object-oriented languages , 1995, PLDI '95.

[19]  Dawson R. Engler,et al.  VCODE: a retargetable, extensible, very fast dynamic code generation system , 1996, PLDI '96.

[20]  Daniel G. Bobrow,et al.  Book review: The Art of the MetaObject Protocol By Gregor Kiczales, Jim des Rivieres, Daniel G. and Bobrow(MIT Press, 1991) , 1991, SGAR.

[21]  Gregory T. Sullivan Dynamic Partial Evaluation , 2001, PADO.