Type systems as macros
Type systems as macros
复制标题
将系统类型作为宏
DOI:
10.1145/3009837.3009886
复制
发表时间:
2017
期刊:
影响因子:
--
通讯作者:
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.