RPython
- 22 October 2007
- proceedings article
- Published by Association for Computing Machinery (ACM)
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.Keywords
This publication has 8 references indexed in Scilit:
- PyPy's approach to virtual machine constructionPublished by Association for Computing Machinery (ACM) ,2006
- MultiJavaACM Transactions on Programming Languages and Systems, 2006
- TraitsACM Transactions on Programming Languages and Systems, 2006
- Towards Type Inference for JavaScriptLecture Notes in Computer Science, 2005
- Making the future safe for the pastPublished by Association for Computing Machinery (ACM) ,1998
- Back to the futurePublished by Association for Computing Machinery (ACM) ,1997
- Mixin-based inheritancePublished by Association for Computing Machinery (ACM) ,1990
- Concepts and experiments in computational reflectionPublished by Association for Computing Machinery (ACM) ,1987