当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Putting gradual types to work
arXiv - CS - Programming Languages Pub Date : 2021-01-28 , DOI: arxiv-2101.12299
Bhargav Shivkumar, Enrique Naudon, Lukasz Ziarek

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.

中文翻译:

使渐进类型起作用

在本文中,我们描述了在使用Hindley-Milner样式类型推断在静态类型的函数语言中结合渐进类型的经验。在大多数渐进类型系统旨在改善动态类型语言的静态检查的地方,我们从相反的角度进行研究,并促进使用静态类型语言的动态检查。我们的方法提供了有关SML和OCaml之类的语言如何处理渐进式键入的一瞥。我们讨论了实现方式和面临的挑战-特别是逐步类型化规则如何适用于我们的复合类型和递归类型的表示。我们回顾了将动态类型添加到静态类型的语言中的各种实现,以突出显示混合静态和动态类型的不同方式,并在保持我们类型系统的渐进性的同时研究了可能的灵感。本文还讨论了在语言中添加渐进类型的动机,以及在工业环境中这样做的实际好处。
更新日期:2021-02-01
down
wechat
bug