我当年读 CS 专业上编译器课的时候(7年前了……),读 Appel 那本《Modern Compiler Implementation in ML》简直痛苦面具。我个人更喜欢 Dick Grune 等人写的那本《Modern Compiler Design》(http://www.dickgrune.com/Books/MCD_1st_Edition/)。第二版好像也正在筹备中了(http://www.dickgrune.com/Books/MCD_2nd_Edition/)。
I had a hard time with Appel's _Modern Compiler Implementation in ML_ when I did the compiler course (7 years ago...) for my CS major. I much preferred _Modern Compiler Design_ by Dick Grune et al. (http://www.dickgrune.com/Books/MCD_1st_Edition/). A second edition seems to be in the pipeline (http://www.dickgrune.com/Books/MCD_2nd_Edition/).
……指令选择和指令调度的部分。)该领域其他挺有意思的书还有:Michael Scott 写的神作《Programming Language Pragmatics》,以及 Grune、Bal、Jacobs 和 Langendoen 合著的《Modern Compiler Design》(这两本对函数式和逻辑编程语言的讲解都很到位[后者更全面一些])
…the instruction selection and instruction scheduling parts.) Other interesting texts in the area are: Michael Scott's excellent "Programming Language Pragmatics" and Grune, Bal, Jacobs and Langendoen's "Modern Compiler Design" (both of which have a nice treatment of functional and logic programming languages [the latter one being more comprehensive])
…techniques are not covered, runtime is treated much more briefly and many practical issues are not discussed at all. There are some nice modern textbooks that are more to the point: http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471... http://www.amazon.com/Engineering-Compiler-Second-Keith-Coop... ANTLR is a great tool and many practical issues I solved with the help of this book about it: http://www.amazon.com/gp/product/1934356999/…
如果想真正实现一个编译器(而不是做语言本身的设计),我推荐 Dick Grune 写的《Modern Compiler Design》。比起龙书(Dragon Book)实用多了,可读性也强得多。至于语言设计本身,你可以去看看这个:http://www.drdobbs.com/architecture-and-design/so-you-want-t... 这些……
For the actual implementation of a compiler (not design of the language itself), I'd recommend "Modern Compiler Design" by Dick Grune. A lot more practical and readable than the Dragon Book. About the language design itself, you might want to have a look to: http://www.drdobbs.com/architecture-and-design/so-you-want-t... These…
Not sure if there are any books around LLVM or gcc, but there is a lot of up to date texts. Grune at al., "Modern Compiler Design", Appel, "Modern Compiler Implementation in ML", and many more. P.S. Because of a slow-ban, adding another one to this answer. This is the best source on SSA: http://www.cri.ensmp.fr/people/pop/papers/2006-12-thesis.pdf
……关于编译器的构建,我推荐这几本:- Torben Mogensen 的《The Basics of Compiler Design》- Andrew Appel 的《Modern Compiler Implementation in C》(也有 ML 和 Java 版本)- Grune、Bal 等人的《Modern Compiler Design》。龙书(Dragon Book)在这一块固然是“声名狼藉”/名头最响,但我建议在啃它之前,至少先读两本稍微基础点的教材垫垫底。
…compiler construction, I would recommend these: - "The Basics of Compiler Design" by Torben Mogensen - "Modern Compiler Implementation in C" by Andrew Appel (ML and Java versions available too) - "Modern Compiler Design" by Grune, Bal et al. The Dragon Book is obviously infamous for this topic, but I would recommend covering at least two slightly more basic texts before taking it on.
我当年读 CS 专业上编译器课的时候(7年前了……),读 Appel 那本《Modern Compiler Implementation in ML》简直痛苦面具。我个人更喜欢 Dick Grune 等人写的那本《Modern Compiler Design》(http://www.dickgrune.com/Books/MCD_1st_Edition/)。第二版好像也正在筹备中了(http://www.dickgrune.com/Books/MCD_2nd_Edition/)。
I had a hard time with Appel's _Modern Compiler Implementation in ML_ when I did the compiler course (7 years ago...) for my CS major. I much preferred _Modern Compiler Design_ by Dick Grune et al. (http://www.dickgrune.com/Books/MCD_1st_Edition/). A second edition seems to be in the pipeline (http://www.dickgrune.com/Books/MCD_2nd_Edition/).
……指令选择和指令调度的部分。)该领域其他挺有意思的书还有:Michael Scott 写的神作《Programming Language Pragmatics》,以及 Grune、Bal、Jacobs 和 Langendoen 合著的《Modern Compiler Design》(这两本对函数式和逻辑编程语言的讲解都很到位[后者更全面一些])
…the instruction selection and instruction scheduling parts.) Other interesting texts in the area are: Michael Scott's excellent "Programming Language Pragmatics" and Grune, Bal, Jacobs and Langendoen's "Modern Compiler Design" (both of which have a nice treatment of functional and logic programming languages [the latter one being more comprehensive])
……这些技术都没讲到,runtime 部分也是一笔带过,很多实战中的工程问题根本提都没提。市面上有一些很棒的现代教材讲得更切中要害:http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471... http://www.amazon.com/Engineering-Compiler-Second-Keith-Coop... ANTLR 是个神器,我靠这本讲它的书解决了不少实际问题:http://www.amazon.com/gp/product/1934356999/……
…techniques are not covered, runtime is treated much more briefly and many practical issues are not discussed at all. There are some nice modern textbooks that are more to the point: http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471... http://www.amazon.com/Engineering-Compiler-Second-Keith-Coop... ANTLR is a great tool and many practical issues I solved with the help of this book about it: http://www.amazon.com/gp/product/1934356999/…
如果想真正实现一个编译器(而不是做语言本身的设计),我推荐 Dick Grune 写的《Modern Compiler Design》。比起龙书(Dragon Book)实用多了,可读性也强得多。至于语言设计本身,你可以去看看这个:http://www.drdobbs.com/architecture-and-design/so-you-want-t... 这些……
For the actual implementation of a compiler (not design of the language itself), I'd recommend "Modern Compiler Design" by Dick Grune. A lot more practical and readable than the Dragon Book. About the language design itself, you might want to have a look to: http://www.drdobbs.com/architecture-and-design/so-you-want-t... These…
不确定有没有专门讲 LLVM 或 gcc 的书,但内容很新的教材可太多了。比如 Grune 等人的《Modern Compiler Design》、Appel 的《Modern Compiler Implementation in ML》等等。又及:因为被 slow-ban 限制发言了,顺便在这条回答里多加一个,这是讲 SSA 最牛的资料:http://www.cri.ensmp.fr/people/pop/papers/2006-12-thesis.pdf
Not sure if there are any books around LLVM or gcc, but there is a lot of up to date texts. Grune at al., "Modern Compiler Design", Appel, "Modern Compiler Implementation in ML", and many more. P.S. Because of a slow-ban, adding another one to this answer. This is the best source on SSA: http://www.cri.ensmp.fr/people/pop/papers/2006-12-thesis.pdf
……关于编译器的构建,我推荐这几本:- Torben Mogensen 的《The Basics of Compiler Design》- Andrew Appel 的《Modern Compiler Implementation in C》(也有 ML 和 Java 版本)- Grune、Bal 等人的《Modern Compiler Design》。龙书(Dragon Book)在这一块固然是“声名狼藉”/名头最响,但我建议在啃它之前,至少先读两本稍微基础点的教材垫垫底。
…compiler construction, I would recommend these: - "The Basics of Compiler Design" by Torben Mogensen - "Modern Compiler Implementation in C" by Andrew Appel (ML and Java versions available too) - "Modern Compiler Design" by Grune, Bal et al. The Dragon Book is obviously infamous for this topic, but I would recommend covering at least two slightly more basic texts before taking it on.