论文标题

与您的选择达成协议:依赖类型的存在

Coming to Terms with Your Choices: An Existential Take on Dependent Types

论文作者

Schmid, Georg Stefan, Blanvillain, Olivier, Hamza, Jad, Kunčak, Viktor

论文摘要

类型级编程是获得额外类型安全性的越来越流行的方式。不幸的是,它仍然是大多数用工业编程语言的二等公民。我们提出了一个新的依赖性类型的系统,该系统具有子类型和单例类型,其目标是以可访问的样式启用类型级别的编程。我们系统的核心是一个非确定性选择操作员。我们认为,拥抱非确定性对于将依赖类型带给更广泛的程序员至关重要,因为现实世界中的程序将不可避免地与不可行的型甚至不纯正的代码进行互动。此外,我们表明,与选择操作员相结合的单胎类型可以替代许多感兴趣的实践功能。我们使用COQ证明助手建立了方法的合理性。我们的健全方法使用其他功能参数来对非确定性进行建模以表示选择。我们代表使用Singleton类型和存在选择参数量化的单例类型和存在类型的类型级计算。为了证明我们类型系统的实用性,我们提出了一种实现,作为Scala编译器的修改。我们提供了一个案例研究,在该案例研究中,我们为Spark数据集开发了强大的包装器。

Type-level programming is an increasingly popular way to obtain additional type safety. Unfortunately, it remains a second-class citizen in the majority of industrially-used programming languages. We propose a new dependently-typed system with subtyping and singleton types whose goal is to enable type-level programming in an accessible style. At the heart of our system lies a non-deterministic choice operator. We argue that embracing non-determinism is crucial for bringing dependent types to a broader audience of programmers, since real-world programs will inevitably interact with imprecisely-typed, or even impure code. Furthermore, we show that singleton types combined with the choice operator can serve as a replacement for many type functions of interest in practice. We establish the soundness of our approach using the Coq proof assistant. Our soundness approach models non-determinism using additional function arguments to represent choices. We represent type-level computation using singleton types and existential types that quantify over choice arguments. To demonstrate the practicality of our type system, we present an implementation as a modification of the Scala compiler. We provide a case study in which we develop a strongly-typed wrapper for Spark datasets.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源