arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2010.14094cs.PL
收藏

抽象渐进式打字前进:精确和空间效率(技术报告)

Abstracting Gradual Typing Moving Forward: Precise and Space-Efficient (Technical Report)

Felipe Bañados Schwerter, Alison M. Clark, Khurram A. Jafery, Ronald Garcia

摘要:

抽象渐进类型化(AGT)是一种设计渐进类型语言的系统方法。使用AGT开发的语言自动满足Siek等人[2015]确定的渐进语言的形式语义标准。尽管如此,vanilla AGT语义仍然有重要的缺点。首先,渐进式语言的运行时检查应该保留底层静态和动态语言固有的空间效率保证。相反,AGT的默认操作语义会破坏正确的尾调用。其次,渐进式语言的运行时检查应该强制执行静态类型规程所期望的基本模块化的基于类型的不变量。相反,AGT的默认操作语义可能无法以令人惊讶的方式强制执行某些不变量。我们在Garcia等人[2016]的$\text{GTFL}_\lesssim$语言中证明了这一点。本文解决了这两个问题,一次通过精炼AGT的动态检查的理论基础。Garcia et al. [2016]观察到AGT涉及两个静态类型的抽象:一个用于静态语义,一个用于动态语义。我们将后者重新定义为子类型本身的抽象解释,而渐进类型仍然抽象静态类型。然后,我们展示了前向完整性[Giacobazzi和Quintarelli 2001]是支持空间高效执行和可靠运行时类型强制的关键。

英文摘要:

Abstracting Gradual Typing (AGT) is a systematic approach to designing gradually-typed languages. Languages developed using AGT automatically satisfy the formal semantic criteria for gradual languages identified by Siek et al. [2015]. Nonetheless, vanilla AGT semantics can still have important shortcomings. First, a gradual language's runtime checks should preserve the space-efficiency guarantees inherent to the underlying static and dynamic languages. To the contrary, the default operational semantics of AGT break proper tail calls. Second, a gradual language's runtime checks should enforce basic modular type-based invariants expected from the static type discipline. To the contrary, the default operational semantics of AGT may fail to enforce some invariants in surprising ways. We demonstrate this in the $\text{GTFL}_\lesssim$ language of Garcia et al. [2016]. This paper addresses both problems at once by refining the theory underlying AGT's dynamic checks. Garcia et al. [2016] observe that AGT involves two abstractions of static types: one for the static semantics and one for the dynamic semantics. We recast the latter as an abstract interpretation of subtyping itself, while gradual types still abstract static types. Then we show how forward-completeness [Giacobazzi and Quintarelli 2001] is key to supporting both space-efficient execution and reliable runtime type enforcement.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑