Staging with control: type-safe multi-stage programming with control
Staging with control: type-safe multi-stage programming with control
复制标题
带控制的分段:带控制的类型安全多阶段编程
DOI:
10.1145/3136040.3136049
复制
发表时间:
2017
期刊:
影响因子:
--
通讯作者:
Junpei Oishi and Yukiyoshi Kameyama
中科院分区:
文献类型:
--
作者:
Yoko Sogabe;Tsutomu Maruyama;Masayuki Suzuki and Maruyama Tsutomu;Takahisa Watanabe and Yukiyoshi Kameyama;Junpei Oishi and Yukiyoshi Kameyama
Staging allows a programmer to write domain-specific, custom code generators. Ideally, a programming language for staging provides all necessary features for staging, and at the same time, gives static guarantee for the safety properties of generated code including well typedness and well scopedness. We address this classic problem for the language with control operators, which allow code optimizations in a modular and compact way. Specifically, we design a staged programming language with the expressive control operators shift0 and reset0, which let us express, for instance, multi-layer let-insertion, while keeping the static guarantee of well typedness and well scopedness. For this purpose, we extend our earlier work on refined environment classifiers which were introduced for the staging language with state. We show that our language is expressive enough to express interesting code generation techniques, and that the type system enjoys type soundness. We also mention a type inference algorithm for our language under reasonable restriction.