Proposed DSL enhances code generation in multi-stage programming, ensuring hygiene and efficiency without host modification.
Extended languages, such as MetaOCaml and Template Haskell, that support multi-stage programming (MSP) provide dedicated syntax for quasiquotation and staged execution, thereby realizing both speedup and abstraction by explicitly handling code generation and execution. By contrast, numerous Lisp-family languages are equipped with quasiquotation and eval, and, except for the benefit of static typing, allow programming in a similar style. However, they have weaknesses in guaranteeing hygiene and in execution efficiency. This study proposes an embedded domain-specific language (DSL) for MSP that, without modifying the host implementation, eliminates eval while achieving both hygiene and high efficiency by associating macro expansion with multi-stage execution. The proposed DSL provides, as natural extensions of macro definition syntax, (1) multi-stage expansion of single-stage descriptions and (2) scope management via embedding and referencing of syntax objects. We perform a comparative evaluation against a naïve MSP implementation and demonstrate that the generated code runs faster.
No takes yet. Share an insight, caveat, or question.
Seiji Umatani (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: