Skip to Main content Skip to Navigation
Conference papers

Julia's efficient algorithm for subtyping unions and covariant tuples (Pearl)

Benjamin Chung 1 Francesco Zappa Nardelli 2 Jan Vitek 1, 3
2 Parkas - Parallélisme de Kahn Synchrone
DI-ENS - Département d'informatique de l'École normale supérieure, CNRS - Centre National de la Recherche Scientifique, Inria de Paris
Abstract : The Julia programming language supports multiple dispatch and provides a rich type annotation language to specify method applicability. When multiple methods are applicable for a given call, Julia relies on subtyping between method signatures to pick the correct method to invoke. Julia's subtyping algorithm is surprisingly complex, and determining whether it is correct remains an open question. In this paper, we focus on one piece of this problem: the interaction between union types and covariant tuples. Previous work normalized unions inside tuples to disjunctive normal form. However, this strategy has two drawbacks: complex type signatures induce space explosion, and interference between normalization and other features of Julia's type system. In this paper, we describe the algorithm that Julia uses to compute subtyping between tuples and unions-an algorithm that is immune to space explosion and plays well with other features of the language. We prove this algorithm correct and complete against a semantic-subtyping denotational model in Coq.
Document type :
Conference papers
Complete list of metadata

Cited literature [27 references]  Display  Hide  Download

https://hal.inria.fr/hal-02297696
Contributor : Francesco Zappa Nardelli <>
Submitted on : Thursday, September 26, 2019 - 12:44:42 PM
Last modification on : Tuesday, January 19, 2021 - 10:16:03 AM
Long-term archiving on: : Monday, February 10, 2020 - 6:03:32 AM

File

main (2).pdf
Files produced by the author(s)

Identifiers

Collections

Citation

Benjamin Chung, Francesco Zappa Nardelli, Jan Vitek. Julia's efficient algorithm for subtyping unions and covariant tuples (Pearl). ECOOP 2019 - 33rd European Conference of Object-Oriented Programming, Jul 2019, London, United Kingdom. ⟨10.4230/LIPIcs.ECOOP.2019.6⟩. ⟨hal-02297696⟩

Share

Metrics

Record views

84

Files downloads

444