If-T: A Benchmark for Type Narrowing
Hanwen Guo (University of Utah, USA), Ben Greenman (University of Utah, USA)

TL;DR
This paper introduces If-T, a benchmark for evaluating type narrowing mechanisms in static type systems for dynamic languages, focusing on correctness validation rather than performance.
Contribution
It provides a standardized, language-agnostic benchmark to assess the ability of type narrowing systems to validate code, addressing a gap in formalization and comparison.
Findings
If-T effectively measures validation capabilities of type systems.
It highlights trade-offs between precision and performance in type narrowing.
The benchmark reveals diverse design choices and their implications.
Abstract
**Context:** The design of static type systems that can validate dynamically-typed programs (**gradually**) is an ongoing challenge. A key difficulty is that dynamic code rarely follows datatype-driven design. Programs instead use runtime tests to narrow down the proper usage of incoming data. Type systems for dynamic languages thus need a **type narrowing** mechanism that refines the type environment along individual control paths based on dominating tests, a form of flow-sensitive typing. In order to express refinements, the type system must have some notion of sets and subsets. Since set-theoretic types are computationally and ergonomically complex, the need for type narrowing raises design questions about how to balance precision and performance. **Inquiry:** To date, the design of type narrowing systems has been driven by intuition, past experience, and examples from users in…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
