没有考古学的Debootstrapping:Camlboot中的堆栈实现
Debootstrapping without Archeology: Stacked Implementations in Camlboot
摘要:
上下文:对于程序设计语言来说,它们的引用实现是在语言本身中实现的,这是很常见的。这需要一个"引导程序":与源代码一起提供以前版本的实现的副本,以便能够运行实现本身。这些引导文件是不透明的二进制文件;它们可能包含错误,甚至可能包含恶意更改,这些更改在运行语言实现的源版本时会复制自己-这被称为“信任信任攻击”。出于这个原因,一个名为Bootstrappable的集体项目在2016年启动,以删除这些引导程序,提供不依赖于不透明二进制文件的替代构建路径。询问:Debootstrapping通常结合了两种方法。“考古学”方法的工作原理是定位不需要引导程序的旧版本系统或遗留替代实现,并保留或恢复运行它们的能力。"定制"方法重新实现系统的新的、非自举实现以解除自举。目前,“定制”方法在低级系统组件(C,coreutils)中占主导地位,而“考古学”方法在少数几个被debootstrapped的高级语言中占主导地位。方法:我们提倡高级语言的"定制"自举实现的好处。新的实现不需要是生产就绪的,只要它能够正确地运行引用实现就足够了。我们认为,这是可行的合理的发展努力,除了debootstrapping几个副作用。知识:我们提出了一个具体的设计组成/堆叠几个实现:一个参考解释器的语言的兴趣,实现在一个小的子集的语言,和这个小的子集(在另一种语言)的编译器。开发一个参考解释器是有价值的独立于debootstrapping:它可以帮助澄清语言语义,并可以重用于其他目的,如其他实现的差异测试。Grounding:我们介绍Camlboot,这是我们的项目,用于对OCaml编译器4.07版本进行自举。一旦我们在这个最终设计上达成一致,Camlboot的最后一个版本就花了大约一个人月的时间来实现,证明了可行性。使用不同的双重编译,我们能够证明在标准OCaml实现的现有引导程序中不存在信任信任攻击。重要性:据我们所知,这篇文档是第一篇关于高级程序设计语言的"定制"自举的学术讨论。Debootstrapping是一个有趣的问题,最近发展了一个活跃的自由软件贡献者社区,但到目前为止,与编程语言研究社区的互动很少。我们分享我们在Camlboot上的经验,试图突出其他语言设计者和实现者感兴趣的方面;我们希望在Bootstrappable项目和相关学术团体之间建立更强的联系。特别是,debootstrapping的经验是对OCaml设计和实现的一个有趣的反思,我们希望其他语言的实现者也能发现它的价值。
英文摘要:
Context: It is common for programming languages that their reference implementation is implemented in the language itself. This requires a "bootstrap": a copy of a previous version of the implementation is provided along with the sources, to be able to run the implementation itself. Those bootstrap files are opaque binaries; they could contain bugs, or even malicious changes that could reproduce themselves when running the source version of the language implementation -- this is called the "trusting trust attack". For this reason, a collective project called Bootstrappable was launched in 2016 to remove those bootstraps, providing alternative build paths that do not rely on opaque binaries. Inquiry: Debootstrapping generally combines a mix of two approaches. The "archaeological" approach works by locating old versions of systems, or legacy alternative implementations, that do not need the bootstrap, and by preserving or restoring the ability to run them. The "tailored" approach re-implements a new, non-bootstrapped implementation of the system to debootstrap. Currently, the "tailored" approach is dominant for low-level system components (C, coreutils), and the "archaeological" approach is dominant among the few higher-level languages that were debootstrapped. Approach: We advocate for the benefits of "tailored" debootstrapping implementations of high-level languages. The new implementation needs not be production-ready, it suffices that it is able to run the reference implementation correctly. We argue that this is feasible with a reasonable development effort, with several side benefits besides debootstrapping. Knowledge: We propose a specific design of composing/stacking several implementations: a reference interpreter for the language of interest, implemented in a small subset of the language, and a compiler for this small subset (in another language). Developing a reference interpreter is valuable independently of debootstrapping: it may help clarify the language semantics, and can be reused for other purposes such as differential testing of the other implementations. Grounding: We present Camlboot, our project to debootstrap the OCaml compiler, version 4.07. Once we converged on this final design, the last version of Camlboot took about a person-month of implementation effort, demonstrating feasibility. Using diverse double-compilation, we were able to prove the absence of trusting trust attack in the existing bootstrap of the standard OCaml implementation. Importance: To our knowledge, this document is the first scholarly discussion of "tailored" debootstrapping for high-level programming languages. Debootstrapping is an interesting problem which recently grew an active community of free software contributors, but so far the interactions with the programming-language research community have been minimal. We share our experience on Camlboot, trying to highlight aspects that are of interest to other language designers and implementors; we hope to foster stronger ties between the Bootstrappable project and relevant academic communities. In particular, the debootstrapping experience has been an interesting reflection on OCaml design and implementation, and we hope that other language implementors would find it equally valuable.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。