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

使用渐变类型

Putting gradual types to work

Bhargav Shivkumar, Enrique Naudon, Lukasz Ziarek

摘要:

在本文中,我们描述了我们的经验,将渐进类型的静态类型的函数式语言与Hindley-Milner风格的类型推断。大多数渐进类型系统的目标是在动态类型语言中改进静态检查,我们从相反的角度来处理它,并在静态类型语言中促进动态检查。我们的方法提供了一个一瞥,像SML和OCaml语言可能会处理渐进类型。我们将讨论我们的实现和面临的挑战--特别是渐进类型规则如何应用于复合和递归类型的表示。我们回顾了将动态类型添加到静态类型语言中的各种实现,以突出混合静态和动态类型的不同方式,并在保持类型系统渐进性的同时检查可能的灵感。本文还讨论了我们在语言中添加渐变类型的动机,以及在我们的工业环境中这样做的实际好处。

英文摘要:

In this paper, we describe our experience incorporating gradual types in a statically typed functional language with Hindley-Milner style type inference. Where most gradually typed systems aim to improve static checking in a dynamically typed language, we approach it from the opposite perspective and promote dynamic checking in a statically typed language. Our approach provides a glimpse into how languages like SML and OCaml might handle gradual typing. We discuss our implementation and challenges faced -- specifically how gradual typing rules apply to our representation of composite and recursive types. We review the various implementations that add dynamic typing to a statically typed language in order to highlight the different ways of mixing static and dynamic typing and examine possible inspirations while maintaining the gradual nature of our type system. This paper also discusses our motivation for adding gradual types to our language, and the practical benefits of doing so in our industrial setting.

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

↑