Polymorphic Records for Dynamic Languages
We study row polymorphism for records types in systems with set-theoretic types, specifically, union, intersection, and negation types. We consider record types that embed row variables and define a subtyping relation by interpreting record types into sets of record values, and row variables into sets of rows , that is, “chunks” of record values where some record keys are left out: subtyping is then containment of the interpretations. We define a λ-calculus equipped with operations for field extension, selection, and deletion, its operational semantics, and a type system that we prove to be sound. We provide algorithms for deciding the typing and subtyping relations, and to decide whether two types can be instantiated to make one subtype of the other. This research is motivated by the current trend of defining static type systems for dynamic languages and, in our case, by an ongoing effort of endowing the Elixir programming language with a gradual type system.
Authors
- Loïc Peyrot (ORCID: https://orcid.org/0000-0002-1398-7460)
- Giuseppe Castagna (ORCID: https://orcid.org/0000-0003-0951-7535)
Institutions
- Centre National de la Recherche Scientifique (FR)
- Université Paris Cité (FR)
- Sorbonne Paris Cité (FR)
- Institut de Recherche en Informatique Fondamentale (FR)
- IMDEA Software Institute (ES)
Publication Details
- Journal
- Proceedings of the ACM on Programming Languages
- Published
- 2025-04-09
- DOI
- https://doi.org/10.1145/3720497
- Citations
- 1
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 2.48
Funders
- HORIZON EUROPE Framework Programme