Casts and costs: harmonizing safety and performance in gradual typing

Casts and costs: harmonizing safety and performance in gradual typing
复制标题

演员和成本:协调渐进打字的安全性和性能

DOI:
10.1145/3236793
复制
发表时间:
2018
影响因子:
--
通讯作者:
Walkingshaw, Eric
Walkingshaw, Eric
中科院分区:
--
文献类型:
--
作者:
Campora, John Peter;Chen, Sheng;Walkingshaw, Eric

文献摘要

参考文献

被引文献

相似文献

渐进式输入允许程序员在单个程序中同时使用静态和动态输入。然而,合理渐进类型的一个众所周知的问题是,静态代码和动态代码之间的交互可能会导致显著的性能下降。这些性能陷阱很难预测和解决,并阻碍用户使用渐进式打字功能。例如,当迁移到更静态类型的程序时,添加类型批注通常会触发速度减慢,这可以通过在其他地方添加更多批注来解决,但由于不清楚必须在哪里添加额外的批注,更容易的解决方案是简单地删除该批注。为了解决这些问题,我们开发了:(1)准确预测逐步类型化程序中静态-动态交互开销的静态开销语义;(2)用于针对程序中可推断类型赋值的所有组合有效地推断此类开销的技术;以及(3)用于将该分析结果转换为特定建议和解释的方法,该方法可以帮助程序员理解、调试和优化逐步类型化程序的性能。我们已经在Herder中实现了我们的方法,这是一个静态分析网状Python程序不同类型配置的性能的工具。对15个Python程序的评估表明,Herder可以使用这种分析来准确有效地推荐类型赋值,从而优化这些程序的性能,而不会牺牲静态类型提供的安全保证。
Gradual typing allows programmers to use both static and dynamic typing in a single program. However, a well-known problem with sound gradual typing is that the interactions between static and dynamic code can cause significant performance degradation. These performance pitfalls are hard to predict and resolve, and discourage users from using gradual typing features. For example, when migrating to a more statically typed program, often adding a type annotation will trigger a slowdown that can be resolved by adding more annotations elsewhere, but since it is not clear where the additional annotations must be added, the easier solution is to simply remove the annotation. To address these problems, we develop: (1) a static cost semantics that accurately predicts the overhead of static-dynamic interactions in a gradually typed program, (2) a technique for efficiently inferring such costs for all combinations of inferrable type assignments in a program, and (3) a method for translating the results of this analysis into specific recommendations and explanations that can help programmers understand, debug, and optimize the performance of gradually typed programs. We have implemented our approach in Herder, a tool for statically analyzing the performance of different typing configurations for Reticulated Python programs. An evaluation on 15 Python programs shows that Herder can use this analysis to accurately and efficiently recommend type assignments that optimize the performance of these programs without sacrificing the safety guarantees provided by static typing.
变分 lambda 演算的容错类型系统
DOI: 10.1145/2364527.2364535
发表时间: 2012
期刊: Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
影响因子: --
作者:
Sheng Chen;Martin Erwig;Eric Walkingshaw
通讯作者: Eric Walkingshaw
随控制流变化而增加计算复杂性的类型理论
DOI: --
发表时间: 2016
期刊: ACM SIGPLAN International Conference on Functional Programming
影响因子: --
作者:
Ezgi Çiçek;Zoe Paraskevopoulou;D. Garg
通讯作者: D. Garg
抽象渐进式打字
DOI: --
发表时间: 2016
期刊: ACM-SIGACT Symposium on Principles of Programming Languages
影响因子: --
作者:
Ronald Garcia;Alison M. Clark;É. Tanter
通讯作者: É. Tanter
声音渐进打字已经死了吗?
DOI: --
发表时间: 2016
期刊: ACM-SIGACT Symposium on Principles of Programming Languages
影响因子: --
作者:
Asumu Takikawa;Daniel Feltey;B. Greenman;Max S. New;J. Vitek;M. Felleisen
通讯作者: M. Felleisen
虚拟机已经知道:利用编译时知识来优化渐进式打字
DOI: 10.1145/3133879
发表时间: 2017
影响因子: --
作者:
G. Richards;Ellen Arteca;Alexi Turcotte
通讯作者: Alexi Turcotte