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.
编译器的正确性是一个旧问题,结果延伸到了过去半个世纪以上。约翰·麦卡锡(John McCarthy)和詹姆斯·画家(James Painter)创立了该领域,着手建造一个“完全值得信赖的编译器”。然而,直到最近,尽管确实令人印象深刻的验证工作,但被证明的定理仅与整个程序的汇编有关,这在理论上很吸引人,但实际上是不切实际的简化。为了使编译器正确性定理确保完全信任,该定理必须反映如何使用编译器的现实。最近有很多关于更现实的“组成”编译器正确性的工作,旨在证明组件的正确编译,同时支持使用不同编译器从不同语言编辑的组件链接。但是,以非常不同的方式指出的各种定理都提出了有关研究人员甚至“编译器是正确”的含义的问题。在这款珍珠中,我们开发了一个新的框架,可以在链接的存在下了解编译器正确性定理,并将其应用于理解和比较结果的多样性。这样一来,我们不仅能够更好地评估他们的相对优势和劣势,而且可以深入了解我们作为社区对未来编译器正确性定理的期望。