RPython: a step towards reconciling dynamically and statically typed OO languages

D. Ancona, M. Ancona, Antonio Cuni, Nicholas D. Matsakis
{"title":"RPython: a step towards reconciling dynamically and statically typed OO languages","authors":"D. Ancona, M. Ancona, Antonio Cuni, Nicholas D. Matsakis","doi":"10.1145/1297081.1297091","DOIUrl":null,"url":null,"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.\n 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.\n 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.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"28 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2007-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"149","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Dynamic Languages Symposium","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1297081.1297091","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 149

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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
RPython:朝着协调动态和静态类型OO语言迈出的一步
尽管基于c语言的Python解释器相当快,但CLI或JVM平台上的实现在健壮性和互操作性方面提供了一些优势。不幸的是,由于CLI和JVM主要设计用于执行静态类型的、面向对象的语言,大多数动态语言实现不能使用本地字节码来进行方法调用和异常处理等常见操作;因此,它们不能充分利用CLI和JVM提供的强大功能。我们描述了一种不同的方法,它试图保持Python的灵活性,同时仍然允许有效的执行。这是通过将Python更多动态特性的使用限制在初始的引导阶段来实现的。此阶段用于构造实际执行的最终RPython(受限Python)程序。RPython是Python的一个适当子集,是静态类型的,不允许动态修改类或方法定义;然而,它仍然可以利用Python的特性,如mixins和一等方法和类。本文概述了RPython,包括它的设计和它到CLI和JVM字节码的转换。我们将展示如何使用引导阶段来实现高级功能,如可扩展类和生成式编程。我们还讨论了在RPython真正为一般使用做好准备之前还有哪些工作要做,并将RPython的性能与其他方法进行了比较。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Optimizing MATLAB feval with dynamic techniques Whalesong: running racket in the browser All about the with statement in JavaScript: removing with statements in JavaScript applications Type refinement for static analysis of JavaScript TeJaS: retrofitting type systems for JavaScript
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1