Type Stability in Julia: Avoiding Performance Pathologies in JIT Compilation (Extended Version)
Artem Pelenitsyn, Julia Belyakova, Benjamin Chung, Ross Tate, Jan, Vitek

TL;DR
This paper formalizes the concept of type stability in Julia, demonstrating its importance for performance, introducing the notion of type groundedness, and analyzing real-world code to promote better programming practices.
Contribution
It provides a formal definition of type stability and groundedness, proves compiler correctness, and analyzes how these properties appear in practice.
Findings
Type groundedness enables compiler optimizations.
Formal proof of compiler correctness for type stability.
Corpus analysis reveals practical manifestation of type properties.
Abstract
As a scientific programming language, Julia strives for performance but also provides high-level productivity features. To avoid performance pathologies, Julia users are expected to adhere to a coding discipline that enables so-called type stability. Informally, a function is type stable if the type of the output depends only on the types of the inputs, not their values. This paper provides a formal definition of type stability as well as a stronger property of type groundedness, shows that groundedness enables compiler optimizations, and proves the compiler correct. We also perform a corpus analysis to uncover how these type-related properties manifest in practice.
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Logic, programming, and type systems · Software Engineering Research
