compiler-construction - 阶段 SBCL 编译器

标签 compiler-construction common-lisp sbcl

我找不到任何可以描述 SBCL 编译器各个阶段的来源。哪些资源(例如论文)描述了 SBCL 编译器的这些阶段?

最佳答案

Phil Khong 的文章 Starting to Hack on SBCL包括如何开始在 SBCL 内部工作的很好的描述。在关于编译器的一节中,他写道,

Finding where the compiler lives

Working on the compiler itself is a bit more work. I think the best approach is to go in src/compiler/main.lisp and look for compile-component. ir1-phases loops on a component and performs high-level optimisations until fixpoint (or we get tired of waiting), while %compile-component handles the conversion to IR2 and then to machine code. The compilation pipeline hasn’t really changed since the Python paper was written, and the subphases each have their own function (and file). M-. on stuff that sounds interesting is probably the best approach at the IR2 level.


那里提到的 Python 论文在文章前面有链接:

Exploring the source

I often see newcomers try to read the source like a book, and, once they realise there’s a lot of code, try to figure out a good order to read the source. I don’t think that’s the best approach. SBCL is pretty huge, and I doubt anyone ever simultaneously holds the complete system in their head. RAM’s “The Python Compiler for CMU Common Lisp” is still useful as an overview, and SBCL’s internals manual is a good supplement. Once you get close to bootstrapping logic, Christophe Rhodes’s “SBCL: a Sanely-Bootstrappable Common Lisp” helps understand the exclamation marks. Past that, I believe it’s preferrable [sic]preferrable to start out small, learn just enough to get the current task done, and accept that some things just work, without asking how (for now).


您可能会对 特别感兴趣第 8 节,编译阶段 来自“CMU Common Lisp 的 Python 编译器”。

关于compiler-construction - 阶段 SBCL 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17251129/

相关文章:

c - 解析 - 导致移位/归约冲突的运算符

c - 编译器警告消息

Delphi 6 - 当我多次编译时错误消失

macos - 在 CLISP 中更新到 ASDF 3.x

arrays - 寻找一种在 2D Lisp 数组上映射函数的方法

performance - 优化简单的 Common Lisp gibbs 采样器程序

functional-programming - 如何通过 QuickLisp 将安装包安装到 SBCL 的系统目录中?

java - 为什么叫动态绑定(bind)而不是静态绑定(bind)呢?

unicode - 列出其中包含 Unicode 符号的目录名称无法正常工作

common-lisp - Common Lisp 从文件读取并存储为列表