Lune

POPL2022顶会

Mœbius: metaprogramming using contextual types: the stage where system f can pattern match on itself

Junyoung Jang, Samuel Gélineau, Stefan Monnier, Brigitte Pientka

摘要

We describe the foundation of the metaprogramming language, Mœbius, which supports the generation of polymorphic code and, more importantly the analysis of polymorphic code via pattern matching.

Mœbius has two main ingredients: 1) we exploit contextual modal types to describe open code together with the context in which it is meaningful. In Mœbius, open code can depend on type and term variables (level 0) whose values are supplied at a later stage, as well as code variables (level 1) that stand for code templates supplied at a later stage. This leads to a multi-level modal lambda-calculus that supports System-F style polymorphism and forms the basis for polymorphic code generation. 2) we extend the multi-level modal lambda-calculus to support pattern matching on code. As pattern matching on polymorphic code may refine polymorphic type variables, we extend our type-theoretic foundation to generate and track typing constraints that arise. We also give an operational semantics and prove type preservation.

Our multi-level modal foundation for Mœbius provides the appropriate abstractions for both generating and pattern matching on open code without committing to a concrete representation of variable binding and contexts. Hence, our work is a step towards building a general type-theoretic foundation for multi-staged metaprogramming that, on the one hand, enforces strong type guarantees and, on the other hand, makes it easy to generate and manipulate code. This will allow us to exploit the full potential of metaprogramming without sacrificing the reliability of and trust in the code we are producing and running.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • A Lightweight Type-and-Effect System for Invalidation Safety: Tracking Permanent and Temporary Invalidation with Constraint-Based Subtype Inference 引用了 Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper7

  1. Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsGuannan Wei, Oliver Bracevac, Songlin Jia, Yuyan Bao 等POPL 2024 · 12 次引用
  2. A Lightweight Type-and-Effect System for Invalidation Safety: Tracking Permanent and Temporary Invalidation with Constraint-Based Subtype InferenceCunyuan Gao, Lionel ParreauxOOPSLA 2025 · 4 次引用
  3. A Dependent Type Theory for Meta-programming with Intensional AnalysisJason Z. S. Hu, Brigitte PientkaPOPL 2025 · 2 次引用
  4. Mechanised Semantics of Multi-stage ProgrammingKa Wing Li, Maite Kramarz, Ningning Xie, Jeremy YallopOOPSLA 2026 · 1 次引用
  5. "Upon This Quote I Will Build My Church Thesis"Pierre-Marie PédrotLICS 2024 · 1 次引用

相关 Paper

  1. Contextual MetaML: Syntax and Full AbstractionHaoxuan Yin, Andrzej S. Murawski, C.-H. Luke OngLICS 2026 · 1 次引用
  2. When Do Staging Annotations Preserve Semantics? Mechanizing Typed Semantics-Preserving Multi-stage Programming with Let-InsertionJun Tan, Guannan WeiOOPSLA 2026
  3. Refined² Environment ClassifiersYuito Murase, Atsushi IgarashiOOPSLA 2026
  4. FreezeML: complete and easy type inference for first-class polymorphismFrank Emrich, Sam Lindley, Jan Stolarek, James Cheney 等PLDI 2020 · 13 次引用
  5. Fulfilling OCaml Modules with TransparencyClement Blaudeau, Didier Rémy, Gabriel RadanneOOPSLA 2024 · 2 次引用
黄昏的海面,两侧是细线勾勒的悬崖