论文标题
朱莉娅(Julia)的世界时代:在存在评估的情况下优化方法调度(扩展版)
World Age in Julia: Optimizing Method Dispatch in the Presence of Eval (Extended Version)
论文作者
论文摘要
动态编程语言在存在功能(例如评估)的情况下面临语义和性能挑战,可以将新代码注入运行程序。朱莉娅(Julia)编程语言介绍了世界时代的新颖概念,该概念将优化的代码与评估最具破坏性的副作用之一隔离:对现有函数的定义的更改。本文在名为Juliette的核心微积分中提供了世界时代的第一个正式语义,并显示了世界时代如何在存在评估的情况下启用编译器优化,例如内部。朱莉娅(Julia)还为程序员提供了绕过世界时代的手段,但我们发现这种机制并未广泛使用:对4,000多个注册的朱莉娅包裹的静态分析表明,只有4-9%的包装旁路世界时代。这表明朱莉娅的语义与程序员的期望保持一致。
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.