Hey Kids, Let’s Write a Compiler Today!

Lambda the Ultimate links to a cool little paper, An Incremental Approach to Compiler Construction. It’s literally a short tutorial on how to write a compiler. It concentrates on the least-complicated but most-intimidating phase: machine code generation.

One Response to “Hey Kids, Let’s Write a Compiler Today!”

  1. [...] 工作如果是和编译器相关的或者编译器爱好者们,谁没有点冲动想自己写个编译器出来。我也做了一些调研,分享如下: How to write your own compiler–介绍如何使用JAVA语言完成一个面向LLVM后端的编译器,以mjava作为目标语言,这是JAVA语言的一个子集。包括词法分析,语法分析,错误控制,符号表管理,类型检查等部分 Hey Kids, Let’s Write a Compiler Today!–采用一种逐步增加功能的方式构造编译器,作者的文章写的很深入前出(我只看了abstract和introduction部分) Let’s Build a Compiler, by Jack Crenshaw –作者从1988-1995年用了7年的时间完成了这份介绍。没有使用flex和yacc这些东西,纯手工制作。使用pascal语言写出的编译器。是一位学物理的博士,很是钦佩! MIT OCW 6.035 Computer Language EngineeringMIT关于计算机工程的开放课程,使用JAVA语言创建一个完整的Decaf语言编译器。我也曾看过一点,但这门课的实验要求有MIT的环境,还有一些库什么的。外面的人拿不到,所以没办法,只能作参考了。 [...]