POPL 2027
Sun 10 - Sat 16 January 2027 Mexico City, Mexico

Quotation in multi-stage programming typically constructs code values that generators can discard or duplicate, potentially changing the reference behavior of the unstaged program. Inspired by the linguistic distinction between use and mention, we propose a use semantics for quotation: instead of constructing a pure code value, quoting is an effectful action to defer a computation to later stages. The semantics of use-quotation is given by elaborating quotations to a core calculus with automatic let-insertion, which preserves the semantics of the original program when quotations are erased. We establish end-to-end erasure soundness with mechanized proofs: the generated code always preserves the semantics of the source program with quotations and splices erased. We also implement use-quotation in a Scala 3 compiler plugin. By explicitly preserving computations across stages, use-quotation offers an alternative to conventional quotation for semantics-preserving staging.