paperbot · PL 论文追踪

全部论文 待读 收藏

P2 MimIR: An Extensible and Type-Safe Intermediate Representation for the DSL Age

MimIR:面向 DSL 时代的可扩展且类型安全的中间表示
POPL 9(POPL)2025匹配度 4/10 · 该论文属于 PL/编译器方向,提出面向 DSL 的可扩展类型安全中间表示,涉及机器学习、数值计算、自动微分等领域的编译优化,与用户对 ML 系统的底层基础设施兴趣有一定关联。但论文核心是 DSL 编译器 IR 与类型系统设计,未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户画像中的核心交叉点,因此匹配度有限。引用 1 inbox
Roland Leißa, Marcel Ullrich, Joachim Meyer, Sebastian Hack
crossref: 2026-09-10

AI 速览

一句话:提出以纯类型系统为核心的可扩展高阶中间表示 MimIR,让开发者以插件形式声明并优化领域特定操作。

面向图像处理、机器学习与数值模拟等计算密集型应用,传统面向底层代码的编译器难以理解领域原语,优化应在领域层面进行;而各 DSL 编译器又反复重造标准优化、代码生成与基础设施。本文提出 MimIR,一种可扩展的高阶中间表示。其核心是一个纯类型系统,本质上是一种带类型的 lambda 演算。开发者可以声明新(领域特定)操作的签名,即公理(axiom);公理可以是函数、类型构造子或任何具有多态、多型(polytypic)乃至依赖类型的实体,从而在任意高低层次上扩展 MimIR,并打包为插件。插件扩展编译器,并负责优化与 lowering 其公理。论文通过三个案例研究展示其表达力与有效性:与 LLVM 同抽象层次的底层插件、正则表达式匹配插件,以及线性代数与自动微分插件;结果表明 MimIR 生成的代码均达到当前最优性能。

问题
传统面向底层代码的编译器无法理解领域特定原语,导致优化难以在合适的抽象层次上进行;同时每个 DSL 编译器都要重复实现标准优化、代码生成与基础设施。
方法
设计可扩展的高阶中间表示 MimIR,其核心为纯类型系统(一种带类型的 lambda 演算);开发者可声明函数、类型构造子等具有多态、多型或依赖类型的公理,并通过插件扩展编译器,由插件负责优化与 lowering 这些公理。
评估
通过三个案例研究评估:与 LLVM 同抽象层次的底层插件、正则表达式匹配插件,以及线性代数与自动微分插件;实验表明 MimIR 生成的代码在三个场景中均达到当前最优性能。
原文摘要(Abstract)

Traditional compilers, designed for optimizing low-level code, fall short when dealing with modern, computation-heavy applications like image processing, machine learning, or numerical simulations. Optimizations should understand the primitive operations of the specific application domain and thus happen on that level. Domain-specific languages (DSLs) fulfill these requirements. However, DSL compilers reinvent the wheel over and over again as standard optimizations, code generators, and general infrastructure & boilerplate code must be reimplemented for each DSL compiler. This paper presents MImIR, an extensible, higher-order intermediate representation. At its core, MImIR is a pure type system and, hence, a form of a typed lambda calculus. Developers can declare the signatures of new (domain-specific) operations, called axioms . An axiom can be the declaration of a function, a type constructor, or any other entity with a possibly polymorphic, polytypic, and/or dependent type. This way, developers can extend MImIR at any low or high level and bundle them in a plugin . Plugins extend the compiler and take care of optimizing and lowering the plugins' axioms. We show the expressiveness and effectiveness of MImIR in three case studies: Low-level plugins that operate at the same level of abstraction as LLVM, a regular-expression matching plugin, and plugins for linear algebra and automatic differentiation. We show that in all three studies, MImIR produces code that has state-of-the-art performance.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3231,
  title = {MimIR: An Extensible and Type-Safe Intermediate Representation for the DSL Age},
  author = {Roland Leißa and Marcel Ullrich and Joachim Meyer and Sebastian Hack},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {POPL},
  year = {2025},
  doi = {10.1145/3704840}
}