一句话:提出统一框架,在存在链接的情况下理解、比较并评估各类编译器正确性定理。
编译器正确性是一个古老问题,但长期以来定理多只针对整程序的编译,虽理论优雅却不符合真实使用中组件链接、跨语言与跨编译器组合的现实。近年出现的“组合式”编译器正确性致力于证明组件的正确编译并支持与其他语言或编译器产物链接,然而这些定理表述各异,使“编译器正确”的含义变得模糊。本文作为函数式珍珠,提出一个理解存在链接时编译器正确性定理的新框架,并用它梳理、归类和比较已有结果。借此不仅能评估各定理的相对强弱,还能反思社区未来应从编译器正确性定理中获得何种保证。
Compiler correctness is an old problem, with results stretching back beyond the last half-century. Founding the field, John McCarthy and James Painter set out to build a "completely trustworthy compiler". And yet, until quite recently, even despite truly impressive verification efforts, the theorems being proved were only about the compilation of whole programs, a theoretically quite appealing but practically unrealistic simplification. For a compiler correctness theorem to assure complete trust, the theorem must reflect the reality of how the compiler will be used. There has been much recent work on more realistic "compositional" compiler correctness aimed at proving correct compilation of components while supporting linking with components compiled from different languages using different compilers. However, the variety of theorems, stated in remarkably different ways, raises questions about what researchers even mean by a "compiler is correct." In this pearl, we develop a new framework with which to understand compiler correctness theorems in the presence of linking, and apply it to understanding and comparing this diversity of results. In doing so, not only are we better able to assess their relative strengths and weaknesses, but gain insight into what we as a community should expect from compiler correctness theorems of the future.
@article{paperbot592,
title = {The next 700 compiler correctness theorems (functional pearl)},
author = {Daniel Patterson and Amal Ahmed},
journal = {Proceedings of the ACM on Programming Languages},
volume = {3},
number = {ICFP},
year = {2019},
doi = {10.1145/3341689}
}