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

以懒求稳,以浅求浅

Seeking Stability by being Lazy and Shallow

Gert-Jan Bottu, Richard A. Eisenberg

摘要:

设计一个语言特性通常需要在几个类似的表达可能性之间进行选择。鉴于用户研究通常是不切实际的,我们建议使用稳定性作为一种方式,使这样的决定。稳定性是衡量一个程序的意义是否会在代码中看似无害的微小变化下发生变化的一种度量。直接出于需要在GHC/Haskell中确定一个功能的动机,我们应用这种稳定性的概念来分析多态类型的实例化的四种方法,得出的结论是最稳定的方法是懒惰(仅在绝对必要时实例化多型)和浅(仅实例化顶级类型变量,而不是显式参数之后出现的变量)。

英文摘要:

Designing a language feature often requires a choice between several, similarly expressive possibilities. Given that user studies are generally impractical, we propose using stability as a way of making such decisions. Stability is a measure of whether the meaning of a program alters under small, seemingly innocuous changes in the code. Directly motivated by a need to pin down a feature in GHC/Haskell, we apply this notion of stability to analyse four approaches to the instantiation of polymorphic types, concluding that the most stable approach is lazy (instantiate a polytype only when absolutely necessary) and shallow (instantiate only top-level type variables, not variables that appear after explicit arguments).

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

↑