paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Staged generic programming

分阶段泛型编程
ICFP 1(ICFP)2017匹配度 1/10 · 该论文属于泛型编程与多阶段编译优化,目标是消除 Scrap Your Boilerplate 的性能开销,不涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析;仅广义上属于程序语言与编译领域,与用户当前研究方向核心无交集。引用 34 inbox
Jeremy Yallop
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:用多阶段编程将 Scrap Your Boilerplate 改造成带类型的优化代码生成器,消除泛型编程的性能开销。

泛型编程库(如 Scrap Your Boilerplate,SYB)能消除重复代码,但通常带来显著性能开销,使程序员不得不在简洁但缓慢与冗长但高效之间选择。本文应用结构化多阶段编程技术,将 SYB 从低效的泛型库转变为带类型的优化代码生成器:在编译期生成特化代码,从而在保持高层泛型表达的同时获得优化执行。评估表明,该方法使泛型程序的性能与手写代码相当,兼顾了高层编程与不妥协的性能。

问题
泛型编程库虽能避免重复代码,却引入显著运行时开销,迫使开发者在简洁性与性能之间取舍。
方法
采用结构化多阶段编程技术,将 Scrap Your Boilerplate 改造成带类型的优化代码生成器,在编译期生成特化代码。
评估
通过性能对比表明,生成代码的性能可与手写代码相当。
原文摘要(Abstract)

Generic programming libraries such as Scrap Your Boilerplate eliminate the need to write repetitive code, but typically introduce significant performance overheads. This leaves programmers with the regrettable choice between writing succinct but slow programs and writing tedious but efficient programs. Applying structured multi-stage programming techniques transforms Scrap Your Boilerplate from an inefficient library into a typed optimising code generator, bringing its performance in line with hand-written code, and so combining high-level programming with uncompromised performance.

链接与引用

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

BibTeX
@article{Yallop17,
  title = {Staged generic programming},
  author = {Jeremy Yallop},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {1},
  number = {ICFP},
  year = {2017},
  doi = {10.1145/3110273}
}