paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Bringing the WebAssembly Standard up to Speed with SpecTec

用 SpecTec 为 WebAssembly 标准提速
PLDI 8(PLDI)2024匹配度 3/10 · 该论文关注 WebAssembly 形式语义的 DSL 与工具体系,属于形式语义/编程语言工程方向,但与用户核心的静态分析、LLM/Agent、浮点程序分析及贝叶斯程序分析均无直接交集。其“单一事实来源+生成解释器/文档”的工程思路有一定参考价值,但研究方向匹配度有限。引用 21 inbox
Dongjun Youn, Wonho Shin, Jaehyun Lee, Sukyoung Ryu, Joachim Breitner, Philippa Gardner, Sam Lindley, Matija Pretnar, Xiaojia Rao, Conrad Watt, Andreas Rossberg
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出 SpecTec DSL 与工具链,将 Wasm 形式规范作为单一事实来源,自动生成规范文档与元级解释器并发现规范错误。

WebAssembly(Wasm)的规范包含完整形式语义,新特性须同时具备形式语义、散文说明和参考解释器,手工维护冗余且易错。本文提出 SpecTec:一种面向 Wasm 规范编写与标准化工件生成的领域特定语言与工具链。SpecTec 作为单一事实来源,可从语义定义生成排版规范(含形式定义与散文伪代码)和元级解释器;测试生成与交互式定理证明后端仍在计划。评估中,SpecTec 可表示最新 Wasm 2.0,生成的元级解释器通过 100% 适用官方测试套件,并发现已修正历史错误及五个候选提案中的十个错误。作者希望 Wasm 标准社区采用 SpecTec 规范未来版本。

问题
Wasm 规范要求每个新特性同时提供形式语义、散文说明和参考解释器,随着语言规模增长,这种手工且冗余的流程变得繁重且易错。
方法
设计 SpecTec DSL 与工具链,将 Wasm 语义的 SpecTec 定义作为单一事实来源,生成排版规范(形式定义与散文伪代码)及元级解释器,并计划扩展测试生成与交互式定理证明后端。
评估
用 SpecTec 表示最新 Wasm 2.0,生成的元级解释器通过 100% 适用官方测试套件;还发现了规范中已修正的历史错误以及五个准备纳入下一版 Wasm 的提案中的十个错误。
原文摘要(Abstract)

WebAssembly (Wasm) is a portable low-level bytecode language and virtual machine that has seen increasing use in a variety of ecosystems. Its specification is unusually rigorous – including a full formal semantics for the language – and every new feature must be specified in this formal semantics, in prose, and in the official reference interpreter before it can be standardized. With the growing size of the language, this manual process with its redundancies has become laborious and error-prone, and in this work, we offer a solution. We present SpecTec, a domain-specific language (DSL) and toolchain that facilitates both the Wasm specification and the generation of artifacts necessary to standardize new features. SpecTec serves as a single source of truth — from a SpecTec definition of the Wasm semantics, we can generate a typeset specification, including formal definitions and prose pseudocode descriptions, and a meta-level interpreter. Further backends for test generation and interactive theorem proving are planned. We evaluate SpecTec’s ability to represent the latest Wasm 2.0 and show that the generated meta-level interpreter passes 100% of the applicable official test suite. We show that SpecTec is highly effective at discovering and preventing errors by detecting historical errors in the specification that have been corrected and ten errors in five proposals ready for inclusion in the next version of Wasm. Our ultimate aim is that SpecTec should be adopted by the Wasm standards community and used to specify future versions of the standard.

链接与引用

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

BibTeX
@article{YounSLRBGLPRWR24,
  title = {Bringing the WebAssembly Standard up to Speed with SpecTec},
  author = {Dongjun Youn and Wonho Shin and Jaehyun Lee and Sukyoung Ryu and Joachim Breitner and Philippa Gardner and Sam Lindley and Matija Pretnar and Xiaojia Rao and Conrad Watt and Andreas Rossberg},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656440}
}