Polymorphic Type Inference for Dynamic Languages - Institut de Recherche en Informatique Fondamentale Access content directly
Journal Articles Proceedings of the ACM on Programming Languages Year : 2024

Polymorphic Type Inference for Dynamic Languages

Abstract

We present a type system that combines, in a controlled way, first-order polymorphism with intersection types, union types, and subtyping, and prove its safety. We then define a type reconstruction algorithm that is sound and terminating. This yields a system in which unannotated functions are given polymorphic types (thanks to Hindley-Milner) that can express the overloaded behavior of the functions they type (thanks to the intersection introduction rule) and that are deduced by applying advanced techniques of type narrowing (thanks to the union elimination rule). This makes the system a prime candidate to type dynamic languages.
Fichier principal
Vignette du fichier
main.pdf (1.14 Mo) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-04284072 , version 1 (16-11-2023)

Licence

Attribution

Identifiers

Cite

Giuseppe Castagna, Mickaël Laurent, Kim Nguyen. Polymorphic Type Inference for Dynamic Languages: Reconstructing Types for Systems Combining Parametric, Ad-Hoc, and Subtyping Polymorphism. Proceedings of the ACM on Programming Languages, inPress, 8 (POPL), pp.40. ⟨10.1145/3632882⟩. ⟨hal-04284072⟩
95 View
18 Download

Altmetric

Share

Gmail Facebook X LinkedIn More