计算机科学 > 程序设计语言
[提交于 2019年12月17日]
标题:Decidable Tag-Based Semantic Subtyping for Nominal Types, Tuples, and Unions
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Semantic subtyping enables simple, set-theoretical reasoning about types by interpreting a type as the set of its values. Previously, semantic subtyping has been studied primarily in the context of statically typed languages with structural typing. In this paper, we explore the applicability of semantic subtyping in the context of a dynamic language with nominal types. Instead of static type checking, dynamic languages rely on run-time checking of type tags associated with values, so we propose using the tags for semantic subtyping. We base our work on a fragment of the Julia language and present tag-based semantic subtyping for nominal types, tuples, and unions, where types are interpreted set-theoretically, as sets of type tags. The proposed subtyping relation is shown to be decidable, and a corresponding analytic definition is provided. The implications of using semantic subtyping for multiple dispatch are also discussed.
提交历史
来自:Julia Belyakova[v1] 2019年12月17日 星期二 19:57:47 UTC