Guard Analysis and Safe Erasure Gradual Typing: a Type System for Elixir

📅 2024-08-26
🏛️ arXiv.org
📈 Citations: 1
Influential: 0
📄 PDF
🤖 AI Summary
To address the lack of high-precision static typing in the dynamically typed functional language Elixir, this paper proposes a progressive semantic subtyping system that requires no modifications to the compiler or runtime. Methodologically, it introduces the first strong static function identification mechanism, integrating fine-grained type inference—based on guard condition modeling and pattern matching—with formalized runtime checks within semantic subtyping theory; type checking is achieved non-intrusively and with zero migration overhead. The key contribution is the first support for high-precision type inference under semantic subtyping constraints within the Elixir ecosystem: it achieves full backward compatibility while significantly improving type coverage and safety. This work establishes a reusable theoretical framework and engineering paradigm for progressive typing in dynamic languages.

Technology Category

Application Category

📝 Abstract
We define several techniques to extend gradual typing with semantic subtyping, specifically targeting dynamic languages. Focusing on the Elixir programming language, we provide the theoretical foundations for its type system. Our approach demonstrates how to achieve type soundness for gradual typing in existing dynamic languages without modifying their compilation, while still maintaining high precision. This is accomplished through the static detection of"strong functions", which leverage runtime checks inserted by the programmer or performed by the virtual machine, and through a fine-grained type analysis of pattern-matching expressions with guards.
Problem

Research questions and friction points this paper is trying to address.

Formalizing a type system for dynamically typed Elixir language
Combining gradual typing with semantic subtyping for static analysis
Ensuring type soundness through runtime checks and guard analysis
Innovation

Methods, ideas, or system contributions that make the work stand out.

Gradual typing with semantic subtyping for Elixir
Strong functions enable precise type assignments
Fine-grained guard analysis for type refinement
🔎 Similar Papers
2024-03-30arXiv.orgCitations: 0
2023-08-03arXiv.orgCitations: 0
Giuseppe Castagna
Giuseppe Castagna
CNRS, Université Paris Cité, France
G
G. Duboc
Université Paris Cité and Remote Technology, France