使用延续和LLVM进行编译
Compiling with Continuations and LLVM
摘要:
LLVM是代码生成和低级优化的基础设施,它作为研究和工业编译器的后端越来越受欢迎,包括许多函数式语言的编译器。虽然LLVM提供了一个相对容易的路径高质量的本地代码,它的设计是基于传统的运行时模型,这是不适合替代编译策略中使用的高级语言编译器,如使用堆分配的延续闭包。本文描述了一种新的基于LLVM的后端,它支持堆分配的延续闭包,这使得常数时间callcc和非常轻量级的多线程。后端已经在并行ML编译器中实现,这是Manticore系统的一部分,但结果应该对其他编译器有用,例如新泽西州的标准ML,使用堆分配的延续闭包。
英文摘要:
LLVM is an infrastructure for code generation and low-level optimizations, which has been gaining popularity as a backend for both research and industrial compilers, including many compilers for functional languages. While LLVM provides a relatively easy path to high-quality native code, its design is based on a traditional runtime model which is not well suited to alternative compilation strategies used in high-level language compilers, such as the use of heap-allocated continuation closures. This paper describes a new LLVM-based backend that supports heap-allocated continuation closures, which enables constant-time callcc and very-lightweight multithreading. The backend has been implemented in the Parallel ML compiler, which is part of the Manticore system, but the results should be useful for other compilers, such as Standard ML of New Jersey, that use heap-allocated continuation closures.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。