Jump to page: 1 2
Thread overview
Any book recommendation for writing a compiler?
Nov 01, 2017
Dr. Assembly
Nov 01, 2017
Dr. Assembly
Nov 01, 2017
Alexandre
Nov 01, 2017
Ali Çehreli
Nov 01, 2017
Jonathan M Davis
Nov 02, 2017
rikki cattermole
Nov 02, 2017
Igor
Nov 02, 2017
Basile B.
Nov 04, 2017
Basile B.
Nov 07, 2017
Basile B.
Nov 04, 2017
Eugene Wissner
Nov 07, 2017
Tony
Nov 09, 2017
Jim Hewes
November 01, 2017
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?
November 01, 2017
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.

November 01, 2017
On 11/01/2017 01:53 PM, 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 haven't read it but one compiler bible is "the dragon book":


https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811

You should also watch Walter's presentation on dmd internals:

  http://dconf.org/2016/talks/bright.html

Ali
November 01, 2017
On Wednesday, November 01, 2017 20:53:44 Dr. Assembly via Digitalmars-d- learn 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?

Well, if you're looking to actually buy a book, this is the one that I used in college and it was good:

https://www.amazon.com/Compiler-Construction-Principles-Kenneth-Louden/dp/0534939724/ref=sr_1_1?ie=UTF8&qid=1509574006&sr=8-1&keywords=louden+compiler

However, the one that folks generally mention is the "dragon book:"

https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811

I haven't read it though, so I can't comment on its contents, just that it's commonly recommended. Neither book is exactly cheap though. There may be some good online resources for learning about compilers, but I don't know them. However, if you're really serious about it, you'll probably want to read a textbook, since it's the sort of area where a good theoretical background to things can be quite useful. Certainly, at minimum, you're going to want to know the differences between things like a lexer and parser and what an abstract syntax tree is.

- Jonathan M Davis

November 01, 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
November 02, 2017
On 01/11/2017 11:13 PM, Jonathan M Davis wrote:
> On Wednesday, November 01, 2017 20:53:44 Dr. Assembly via Digitalmars-d-
> learn 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?
> 
> Well, if you're looking to actually buy a book, this is the one that I used
> in college and it was good:
> 
> https://www.amazon.com/Compiler-Construction-Principles-Kenneth-Louden/dp/0534939724/ref=sr_1_1?ie=UTF8&qid=1509574006&sr=8-1&keywords=louden+compiler

Out of stock: https://www.thriftbooks.com/w/compiler-construction-principles-and-practice_kenneth-c-louden/263600/#isbn=0534939724

> However, the one that folks generally mention is the "dragon book:"
> 
> https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811

https://www.thriftbooks.com/w/compiladores-principios-tecnicas-y-herramientas_alfred-v-aho/248872/#isbn=0201100886

> I haven't read it though, so I can't comment on its contents, just that it's
> commonly recommended. Neither book is exactly cheap though. There may be
> some good online resources for learning about compilers, but I don't know
> them. However, if you're really serious about it, you'll probably want to
> read a textbook, since it's the sort of area where a good theoretical
> background to things can be quite useful. Certainly, at minimum, you're
> going to want to know the differences between things like a lexer and parser
> and what an abstract syntax tree is.
> 
> - Jonathan M Davis

I'd call it cheap ;) It isn't too bad grounding in everything, but doesn't branch out much (which is fine) and yeah invest in the hard cover version, its well worth it.
November 02, 2017
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 found this to be quite helpful: http://llvm.org/docs/tutorial/  Specifically the Kaleidoscope tutorial.

Mike
November 02, 2017
On Thursday, 2 November 2017 at 03:55:27 UTC, Michael V. Franklin 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 found this to be quite helpful: http://llvm.org/docs/tutorial/  Specifically the Kaleidoscope tutorial.
>
> Mike

If you are interested in using LLVM my little project might be helpful: https://github.com/igor84/summus
November 02, 2017
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?

You don't need to read books to write a compiler, a bit of theory from "here or there" will be enough, particularly if you start from scratch, there's almost no chance that you ever touch the more edgy things (something like theory of types maybe ).

A few ones written in D (sorted by URL length):

- https://github.com/dlang/dmd
- https://github.com/BBasile/yatol
- https://github.com/higgsjs/Higgs
- https://github.com/VoltLang/Volta
- https://github.com/beast-lang/beast-dragon

Otherwise a subreddit that's not been quoted yet:

- https://www.reddit.com/r/ProgrammingLanguages/ and their homepage listing a few projects from people who have started "the journey": http://www.proglangdesign.net/
November 04, 2017
On Thursday, 2 November 2017 at 14:24:01 UTC, Basile B. 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?
>
> You don't need to read books to write a compiler, a bit of theory from "here or there" will be enough, particularly if you start from scratch, there's almost no chance that you ever touch the more edgy things (something like theory of types maybe ).
>
> A few ones written in D (sorted by URL length):
>
> - https://github.com/dlang/dmd
> - https://github.com/BBasile/yatol
> - https://github.com/higgsjs/Higgs
> - https://github.com/VoltLang/Volta
> - https://github.com/beast-lang/beast-dragon
>
> Otherwise a subreddit that's not been quoted yet:
>
> - https://www.reddit.com/r/ProgrammingLanguages/ and their homepage listing a few projects from people who have started "the journey": http://www.proglangdesign.net/

Dr Assembly what i mean can be illustrated by this:

You see this https://github.com/matijapretnar/eff ?
http://www.eff-lang.org/ ?

People who say that after reading the dragon book, you will program your own programming language are lying.

« First   ‹ Prev
1 2