paperbot · PL 论文追踪

RSS

MacoCaml: Staging Composable and Compilable Macros

ICFP 7(ICFP)2023
Ningning Xie, Leo White, Olivier Nicole, Jeremy Yallop

尚未生成 AI 速览(可能缺少 API key 或等待下次运行补跑)。

原文摘要(Abstract)

We introduce MacoCaml, a new design and implementation of compile-time code generation for the OCaml language. MacoCaml features a novel combination of macros with phase separation and quotation-based staging, where macros are considered as compile-time bindings, expression cross evaluation phases using staging annotations, and compile-time evaluation happens inside top-level splices. We provide a theoretical foundation for MacoCaml by formalizing a typed source calculus maco that supports interleaving typing and compile-time code generation, references with explicit compile-time heaps, and modules. We study various crucial properties including soundness and phase distinction. We have implemented MacoCaml in the OCaml compiler, and ported two substantial existing libraries to validate our implementation.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot1907,
  title = {MacoCaml: Staging Composable and Compilable Macros},
  author = {Ningning Xie and Leo White and Olivier Nicole and Jeremy Yallop},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {ICFP},
  year = {2023},
  doi = {10.1145/3607851}
}