Type systems as macros

Type systems as macros
复制标题

将系统类型作为宏

DOI:
10.1145/3009837.3009886
复制
发表时间:
2017
期刊:
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
影响因子:
--
通讯作者:
B. Greenman
B. Greenman
中科院分区:
--
文献类型:
--
作者:
Stephen Chang;Alex Knauth;B. Greenman

文献摘要

被引文献

相似文献

我们提出旋转门,这是一种用于创建键入嵌入式语言的金属语言。要实现类型系统,程序员编写类型检查规则类似于传统的判断语法。为了实施语义,他们将精心设计纳入了这些规则。旋转栅门在很大程度上取决于语言重复使用的观念。它以一种新颖的方式利用宏系统,以同时键入检查并将表面程序重写为目标语言。重用宏系统还产生模块化实现,其规则可以混合并匹配以创建其他语言。结合典型的编译器和运行时的重用,旋转门几乎没有努力产生表演者打字的嵌入式语言。
We present Turnstile, a metalanguage for creating typed embedded languages. To implement the type system, programmers write type checking rules resembling traditional judgment syntax. To implement the semantics, they incorporate elaborations into these rules. Turnstile critically depends on the idea of linguistic reuse. It exploits a macro system in a novel way to simultaneously type check and rewrite a surface program into a target language. Reusing a macro system also yields modular implementations whose rules may be mixed and matched to create other languages. Combined with typical compiler and runtime reuse, Turnstile produces performant typed embedded languages with little effort.