首页> 外文OA文献 >Compiling dynamic languages via statically typed functional languages
【2h】

Compiling dynamic languages via statically typed functional languages

机译:通过静态类型的功能语言编译动态语言

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

Dynamic languages enable rapid prototyping, but are generally not viewed as providing the best performance. As a result, software developers generally build a prototype in a dynamic language and then rewrite the application in C or Fortran for high performance. This costly rewriting step can be avoided by improving the performance of dynamic languages. Dynamic languages are usually interpreted for easier implementation. The traditional approach to improve their performance is to build an optimizing compiler. However, building a compiler from scratch is much more time-consuming than implementing an interpreter. Our thesis is that we can build effective compilers for dynamic languages by translating them into statically typed functional languages which have good compilers and automatic memory management. In particular, we believe that modern statically typed languages provide precise control over data representations, and come with runtime systems that have competitive performance.To investigate the viability of this approach, we have built a compiler for the dynamic language Python by translating it into the statically typed functional language OCaml. An interesting practical advantage of using modern statically typed functional languages is that they use Hindley-Milner type systems, which means that there is no need for the translation to construct type terms.We compare the performance of our implementation, Monty, with that of CPython, the reference Python implementation, and with Jython, a Java implementation of Python, using a suite of 370 benchmarks. Our experiments show that some programs compiled using our approach run up to 4.6 times faster than CPython. However, due to a number of engineering reasons, some programs also run significantly slower than CPython. We pinpoint the specific causes of performance degradation and assess the potential for removing these causes in future work. Our implementation is significantly faster than Jython, up to a factor of 100 in some cases.A by product of our research is a proposal for an improved array copying implementation in OCaml.
机译:动态语言可实现快速原型制作,但通常不被视为提供最佳性能。结果,软件开发人员通常使用动态语言构建原型,然后用C或Fortran重写应用程序以实现高性能。通过提高动态语言的性能,可以避免此昂贵的重写步骤。动态语言通常被解释为易于实现。改善其性能的传统方法是构建优化的编译器。但是,从头开始构建编译器比实现解释器要花费更多的时间。我们的观点是,我们可以通过将动态语言翻译成具有良好编译器和自动内存管理功能的静态类型函数语言,来构建有效的动态语言编译器。特别是,我们认为现代静态类型语言可以提供对数据表示的精确控制,并具有性能卓越的运行时系统。为了研究这种方法的可行性,我们通过将动态语言Python编译为编译器来为其构建了编译器静态类型的功能语言OCaml。使用现代静态类型函数语言的一个有趣的实践优势是,它们使用Hindley-Milner类型系统,这意味着不需要翻译来构造类型术语。我们将实现的性能Monty和CPython的性能进行了比较。 ,参考Python实现以及Jython(Python的Java实现)使用了370个基准测试套件。我们的实验表明,使用我们的方法编译的某些程序的运行速度比CPython快4.6倍。但是,由于多种工程原因,某些程序的运行速度也比CPython慢​​得多。我们查明性能下降的具体原因,并评估在将来的工作中消除这些原因的可能性。我们的实现比Jython快得多,在某些情况下可达100倍。我们研究的副产品是在OCaml中改进阵列复制实现的建议。

著录项

  • 作者

    Bandyopadhyay Rajarshi;

  • 作者单位
  • 年度 2009
  • 总页数
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类

相似文献

  • 外文文献
  • 中文文献
  • 专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号