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).
翻译:语言特征的设计往往需要在几种相似的表达可能性之间做出选择。 鉴于用户研究通常不切实际,我们提议使用稳定性作为做出此类决定的一种方式。 稳定性是衡量一个方案的含义是否在代码中小的、似乎无端的改变的一种尺度。 直接出于将一个特征划入GHC/Haskell的需要,我们运用这种稳定性概念来分析四种方法对多种形态类型的即时化,我们的结论是,最稳定的方法是懒惰的(只有在绝对必要的情况下才对一个多型)和浅的(仅对顶级类型的变量,而不是在明确论据之后出现的变量) 。