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

TL;DR
This paper formalizes Julia's world age concept, demonstrating how it enables safe optimizations like inlining despite eval, and shows that most packages adhere to this semantics, indicating alignment with programmer expectations.
Contribution
It provides the first formal semantics of world age in Julia through the Juliette calculus and analyzes its practical usage in real packages.
Findings
World age enables compiler optimizations like inlining with eval.
Only 4-9% of packages bypass world age, showing general adherence.
Formal semantics clarify how Julia maintains performance and correctness.
Abstract
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Parallel Computing and Optimization Techniques · Distributed systems and fault tolerance
