|
ABSTRACT
Although the C-based interpreter of Python is reasonably fast, implementations on the CLI or the JVM platforms offers some advantages in terms of robustness and interoperability. Unfortunately, because the CLI and JVM are primarily designed to execute statically typed, object-oriented languages, most dynamic language implementations cannot use the native bytecodes for common operations like method calls and exception handling; as a result, they are not able to take full advantage of the power offered by the CLI and JVM. We describe a different approach that attempts to preserve the flexibility of Python, while still allowing for efficient execution. This is achieved by limiting the use of the more dynamic features of Python to an initial, bootstrapping phase. This phase is used to construct a final RPython (Restricted Python) program that is actually executed. RPython is a proper subset of Python, is statically typed, and does not allow dynamic modification of class or method definitions; however, it can still take advantage of Python features such as mixins and first-class methods and classes. This paper presents an overview of RPython, including its design and its translation to both CLI and JVM bytecode. We show how the bootstrapping phase can be used to implement advanced features, like extensible classes and generative programming. We also discuss what work remains before RPython is truly ready for general use, and compare the performance of RPython with that of other approaches.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
C. S. Ananian. The static single information form. Technical Report MIT-LCS-TR-801, MIT Laboratory for Computer Science Technical Report, September 1999. Master's thesis.
|
| |
2
|
C. Anderson, P. Giannini, and S. Drossopoulou. Towards type inference for javascript. In 19th European Conference on Object-Oriented Programming (ECOOP 2005), LNCS 3586, pages 428--453. Springer, 2005.
|
 |
3
|
|
 |
4
|
Gilad Bracha , Martin Odersky , David Stoutamire , Philip Wadler, Making the future safe for the past: adding genericity to the Java programming language, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.183-200, October 18-22, 1998, Vancouver, British Columbia, Canada
|
 |
5
|
Curtis Clifton , Todd Millstein , Gary T. Leavens , Craig Chambers, MultiJava: Design rationale, compiler implementation, and applications, ACM Transactions on Programming Languages and Systems (TOPLAS), v.28 n.3, p.517-575, May 2006
[doi> 10.1145/1133651.1133655]
|
| |
6
|
|
| |
7
|
A. Cuni, S. Pedroni, A. Chrigström, H. Krekel, G. Wesdorp, and C. F. Bolz. High-level backends and interpreter feature prototypes. Technical Report D12.1, PyPy Consortium, 2007. http://codespeak.net/pypy/dist/pypy/doc/index-report.html.
|
 |
8
|
|
| |
9
|
ECMA. ECMA-335: Common Language Infrastructure (CLI). ECMA, Geneva (CH), third edition, June 2005.
|
| |
10
|
C. Esterbrook. Using Mix-ins with Python. http://www.linuxjournal.com/article/4540.
|
| |
11
|
|
 |
12
|
Dan Ingalls , Ted Kaehler , John Maloney , Scott Wallace , Alan Kay, Back to the future: the story of Squeak, a practical Smalltalk written in itself, Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.318-326, October 05-09, 1997, Atlanta, Georgia, United States
|
| |
13
|
IronPython. http://www.codeplex.com/IronPython.
|
| |
14
|
JRuby. http://jruby.codehaus.org/.
|
| |
15
|
Jython. http://www.jython.org/.
|
| |
16
|
S. Keene. CLOS and the Meta Object Protocol. Addison Wesley Publishing Company, 1989.
|
| |
17
|
|
| |
18
|
|
| |
19
|
|
 |
20
|
|
| |
21
|
Martin Richards. Bcpl benchmark. http://www.cl.cam.ac.uk/~mr10/Bench.html.
|
| |
22
|
E. Meijer and P. Drayton. Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages. In OOPSLA'04 Workshop on Revival of Dynamic Languages, 2004.
|
| |
23
|
Microsoft .NET. http://www.microsoft.com/net/.
|
| |
24
|
Rhino. http://www.mozilla.org/rhino/.
|
| |
25
|
A. Rigo, M. Hudson, and S. Pedroni. Compiling dynamic language implementations. Technical Report D05.1, PyPy Consortium, 2005. http://codespeak.net/pypy/dist/pypy/doc/index-report.html.
|
 |
26
|
Armin Rigo , Samuele Pedroni, PyPy's approach to virtual machine construction, Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
[doi> 10.1145/1176617.1176753]
|
| |
27
|
Slang. http://wiki.squeak.org/squeak/2267.
|
| |
28
|
Sun Microsystems. JSR 292: Supporting dynamically typed languages on the Java platform. http://jcp.org/en/jsr/detail?id=292.
|
| |
29
|
The Mono Project. http://www.mono-project.com.
|
| |
30
|
C. to PyPy. http://codespeak.net/pypy/dist/pypy/doc/contributor.html.
|
| |
31
|
G. Van Rossum. Unifying types and classes in Python 2.2. http://www.python.org/download/releases/2.2.3/descrintro/.
|
CITED BY 3
|
|
|
|
|
Carl Friedrich Bolz , Antonio Cuni , Maciej Fijalkowski , Armin Rigo, Tracing the meta-level: PyPy's tracing JIT compiler, Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, p.18-25, July 06-06, 2009, Genova, Italy
|
|
|
Antonio Cuni , Davide Ancona , Armin Rigo, Faster than C#: efficient implementation of dynamic languages on .NET, Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, p.26-33, July 06-06, 2009, Genova, Italy
|
|