English

Builtin Types viewed as Inductive Families

Programming Languages 2023-01-06 v1

Abstract

State of the art optimisation passes for dependently typed languages can help erase the redundant information typical of invariant-rich data structures and programs. These automated processes do not dramatically change the structure of the data, even though more efficient representations could be available. Using Quantitative Type Theory, we demonstrate how to define an invariant-rich, typechecking time data structure packing an efficient runtime representation together with runtime irrelevant invariants. The compiler can then aggressively erase all such invariants during compilation. Unlike other approaches, the complexity of the resulting representation is entirely predictable, we do not require both representations to have the same structure, and yet we are able to seamlessly program as if we were using the high-level structure.

Keywords

Cite

@article{arxiv.2301.02194,
  title  = {Builtin Types viewed as Inductive Families},
  author = {Guillaume Allais},
  journal= {arXiv preprint arXiv:2301.02194},
  year   = {2023}
}

Comments

32 pages, accepted for publication at ESOP'23

R2 v1 2026-06-28T08:04:08.870Z