Any book recommendation for writing a compiler?

Alexandre alebencz at gmail.com
Wed Nov 1 22:56:11 UTC 2017


On Wednesday, 1 November 2017 at 20:56:22 UTC, Dr. Assembly wrote:
> On Wednesday, 1 November 2017 at 20:53:44 UTC, Dr. Assembly 
> wrote:
>> Hey guys, if I were to get into dmd's source code to play a 
>> little bit (just for fun, no commercial use at all), which 
>> books/resources do you recommend to start out?
>
> I'd like something on back-end too, for example, code 
> generation, convert the AST to actual assembly/machine code. On 
> my research I found mostly front-end related stuff, like 
> recursive descent parser.

Look at this book: https://www.t3x.org/reload/index.html

Some cool open source languages:
* Elena programming language: 
https://github.com/ELENA-LANG/elena-lang
* DotNetPeLib: https://github.com/LADSoft/DotNetPELib
* OrangeC/C++ compiler: https://github.com/LADSoft/OrangeC


I have some cool projects:
* A simple C compiler that generates a EXE/DLL: 
https://gist.github.com/bencz/79d4738afe962b5479d1
* CoffLib ( a lib to generate x86 EXE/DLL in .Net ) : 
https://github.com/bencz/CoffLib
* Zinnia-lang: https://github.com/bencz/Zinnia-lang
* dncpp: https://github.com/bencz/dncpp
* Pythonish-Compiler: https://github.com/bencz/Pythonish-Compiler


More information about the Digitalmars-d-learn mailing list