gpt4 book ai didi

code-generation - 什么是编译的好资源?

转载 作者:行者123 更新时间:2023-12-02 08:54:58 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Learning Resources on Parsers, Interpreters, and Compilers [closed]

(12 个回答)


8年前关闭。




不耐烦的总结:我正在寻找关于为通用语言结构生成代码而不是解析的良好引用。

我对编程语言很感兴趣,并尝试尽可能多地阅读文献。但他们中的大多数都从功能和理论的角度涵盖了这个主题,我发现他们很难理解,更不用说实现这些想法了。

所以问题是;对于以更加命令式和实用的方式涵盖该主题的编程语言实现,您建议使用哪些资源?

例如,我发现“Lua 5.0 的实现”论文很有启发性。

请注意,我不是在寻找有关解析或标记化的文章。

最佳答案

据说(我通读了,但还没有完成),An Incremental Approach to Compiler Construction非常好。它描述了作者如何教授他的编译器类(class)。

从摘要:

Compilers are perceived to be magical artifacts, carefully crafted by the wizards, and unfathomable by the mere mortals. Books on compilers are better described as wizard-talk: written by and for a clique of all-knowing practitioners. Real-life compilers are too complex to serve as an educational tool. And the gap between real-life compilers and the educational toy compilers is too wide. The novice compiler writer stands puzzled facing an impenetrable barrier, “better write an interpreter instead.”

The goal of this paper is to break that barrier. We show that building a compiler can be as easy as building an interpreter. The compiler we construct accepts a large subset of the Scheme programming language and produces assembly code for the Intel-x86 architecture, the dominant architecture of personal computing. The development of the compiler is broken into many small incremental steps. Every step yields a fully working compiler for a progressively expanding subset of Scheme. Every compiler step produces real assembly code that can be assembled then executed directly by the hardware. We assume that the reader is familiar with the basic computer architecture: its components and execution model. Detailed knowledge of the Intel-x86 architecture is not required.

The development of the compiler is described in detail in an extended tutorial. Supporting material for the tutorial such as an automated testing facility coupled with a comprehensive test suite are provided with the tutorial. It is our hope that current and future implementors of Scheme find in this paper the motivation for developing high-performance compilers and the means for achieving that goal.

关于code-generation - 什么是编译的好资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/153330/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com