arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2010.07516cs.PL
收藏

Julia的World Age:Optimizing Method Dispatch in the Presence of Eval(扩展版)

World Age in Julia: Optimizing Method Dispatch in the Presence of Eval (Extended Version)

Julia Belyakova, Benjamin Chung, Jack Gelinas, Jameson Nash, Ross Tate, Jan Vitek

摘要:

动态规划语言面临着语义和性能方面的挑战,例如eval,它可以将新代码注入到正在运行的程序中。Julia程序设计语言引入了世界时代的新概念,将优化的代码与eval最具破坏性的副作用之一隔离开来:对现有函数定义的更改。本文提供了第一个正式的语义世界时代的核心演算命名朱丽叶,并显示了世界时代如何使编译器优化,如内联,在eval的存在。虽然Julia也为程序员提供了绕过world age的方法,但我们发现这种机制并没有被广泛使用:对4,000多个注册Julia软件包的静态分析显示,只有4-9%的软件包绕过了world age。这表明Julia的语义符合程序员的期望。

英文摘要:

Dynamic programming languages face semantic and performance challenges in the presence of features, such as eval, that can inject new code into a running program. The Julia programming language introduces the novel concept of world age to insulate optimized code from one of the most disruptive side-effects of eval: changes to the definition of an existing function. This paper provides the first formal semantics of world age in a core calculus named Juliette, and shows how world age enables compiler optimizations, such as inlining, in the presence of eval. While Julia also provides programmers with the means to bypass world age, we found that this mechanism is not used extensively: a static analysis of over 4,000 registered Julia packages shows that only 4-9% of packages bypass world age. This suggests that Julia's semantics aligns with programmer expectations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑