Modern languages are equipped with static type checking/inference that helps programmers to keep a clean programming style and to reduce errors. However, the ever-growing size of programs and their continuous evolution require building fast and efficient analysers. A promising solution is incrementality, so one only re-types those parts of the program that are new, rather than the entire codebase. We propose an algorithmic schema driving the definition of an incremental typing algorithm that exploits the existing, standard ones with no changes. Ours is a grey-box approach, meaning that just the shape of the input, that of the results and some domain-specific knowledge are needed to instantiate our schema. Here, we present the foundations of our approach and we show it at work to derive three different incremental typing algorithms. The first two implement type checking and inference for a functional language. The last one type-checks an imperative language to detect information flow and non-interference. We assessed our proposal on a prototypical implementation of an incremental type checker. Our experiments show that using the type checker incrementally is (almost) always rewarding.
静态类型函数式语言的一个长期存在的缺点是类型检查不能排除模式匹配失败(运行时匹配异常)。细化类型区分不同的数据类型值;如果用细化注释的程序通过了类型检查,那么模式匹配失败就变得不可能了。不幸的是,细化是类型的单一属性,这加剧了向非平凡程序添加细化类型的难度。渐进式类型化探索了如何在静态类型化和动态类型化之间渐进地移动。我们开发了一个类型系统的逐步总和,结合细化与不精确。然后,我们开发了一个双向版本的类型系统,它排除了过度的不精确性,并给出了一个类型导向的翻译到一个目标语言显式转换。我们证明了静态子语言不能有匹配失败,一个良好类型的程序仍然是良好类型的,如果它的类型注释不太精确,并使注释不太精确的原因目标程序失败后。其中一些结果与Siek et al.(2015)给出的渐进分型标准相对应。
Web of Linked Data是Web标准社区十多年来努力使数据更像Web的工作的累积。我们从想要使用关联数据构建应用程序的Web开发人员的角度介绍了关联数据Web。我们发现开发堆栈中的一个弱点是缺乏用于设计使用关联数据的后台流程的特定于领域的脚本语言。为了解决这个弱点,我们设计了一个脚本语言,它有一个简单但合适的类型系统。在我们提出的体系结构中,一些数据是从系统控制之外的源消耗的,一些数据是本地保存的。可以对本地数据进行比外部数据更强的类型假设,因此我们的类型系统混合了静态和动态类型。在整个过程中,我们将我们的工作与驱动关联数据的W3C建议相关联,因此我们的语法对Web开发人员来说是可访问的。