ACM Home Page
Please provide us with feedback. Feedback
RPython: a step towards reconciling dynamically and statically typed OO languages
Full text PdfPdf (239 KB)
Source
Dynamic Languages Symposium archive
Proceedings of the 2007 symposium on Dynamic languages table of contents
Montreal, Quebec, Canada
SESSION: Integrating static features into dynamic languages table of contents
Pages: 53 - 64  
Year of Publication: 2007
ISBN:978-1-59593-868-8
Authors
Davide Ancona  University of Genova, Genova, Italy
Massimo Ancona  University of Genova, Genova, Italy
Antonio Cuni  University of Genova, Genova, Italy
Nicholas D. Matsakis  ETH, Zurich, Switzerland
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 11,   Downloads (12 Months): 92,   Citation Count: 3
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1297081.1297091
What is a DOI?

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
5
 
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
 
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
 
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/.


Collaborative Colleagues:
Davide Ancona: colleagues
Massimo Ancona: colleagues
Antonio Cuni: colleagues
Nicholas D. Matsakis: colleagues