digitalmars.D.learn - Any book recommendation for writing a compiler?
- Dr. Assembly (3/3) Nov 01 2017 Hey guys, if I were to get into dmd's source code to play a
- Dr. Assembly (5/8) Nov 01 2017 I'd like something on back-end too, for example, code generation,
- Alexandre (15/24) Nov 01 2017 Look at this book: https://www.t3x.org/reload/index.html
- =?UTF-8?Q?Ali_=c3=87ehreli?= (7/10) Nov 01 2017 I haven't read it but one compiler bible is "the dragon book":
- Jonathan M Davis (16/19) Nov 01 2017 Well, if you're looking to actually buy a book, this is the one that I u...
- rikki cattermole (7/30) Nov 01 2017 Out of stock:
- Michael V. Franklin (4/7) Nov 01 2017 I found this to be quite helpful: http://llvm.org/docs/tutorial/
- Igor (4/13) Nov 02 2017 If you are interested in using LLVM my little project might be
- Basile B. (15/18) Nov 02 2017 You don't need to read books to write a compiler, a bit of theory
- Basile B. (6/26) Nov 04 2017 Dr Assembly what i mean can be illustrated by this:
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (8/10) Nov 04 2017 Well, you most certainly can write your own programming language
- Basile B. (5/11) Nov 06 2017 I've just read the dragon book. let's write a compiler
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (4/14) Nov 07 2017 A basic compiler is not so complicated. Just align the semantics
- Eugene Wissner (16/19) Nov 04 2017 A few more resources on writing a frontend (lexer, syntactic and
- Tony (6/6) Nov 07 2017 Author Allen Holub has made his out-of-print book, Compiler
- Jim Hewes (4/21) Nov 09 2017 Thanks for those references! I'm also interested in looking through
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?
Nov 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.
Nov 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: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-CompilerHey 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.
Nov 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
Nov 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
Nov 01 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:Out of stock: https://www.thriftbooks.com/w/compiler-construction-principles-and-practice_kenneth-c-louden/263600/#isbn=0534939724Hey 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+compilerHowever, the one that folks generally mention is the "dragon book:" https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811https://www.thriftbooks.com/w/compiladores-principios-tecnicas-y-herramientas_alfred-v-aho/248872/#isbn=0201100886I 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 DavisI'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.
Nov 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 found this to be quite helpful: http://llvm.org/docs/tutorial/ Specifically the Kaleidoscope tutorial. Mike
Nov 01 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:If you are interested in using LLVM my little project might be helpful: https://github.com/igor84/summusHey 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
Nov 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/
Nov 02 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: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.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/
Nov 04 2017
On Saturday, 4 November 2017 at 15:51:30 UTC, Basile B. wrote:People who say that after reading the dragon book, you will program your own programming language are lying.Well, you most certainly can write your own programming language after reading about 30% of the dragon book, but I think you can find easier books to get started these days. For more advanced stuff I would recommend downloading power points or notes from university courses on master or ph.d. level. The books and articles on more advanced stuff are often heavy on formalisms and difficult to digest for most programmers.
Nov 04 2017
On Saturday, 4 November 2017 at 20:28:17 UTC, Ola Fosheim Grøstad wrote:On Saturday, 4 November 2017 at 15:51:30 UTC, Basile B. wrote:I've just read the dragon book. let's write a compiler https://imgur.com/1pFeat8 ;-)People who say that after reading the dragon book, you will program your own programming language are lying.Well, you most certainly can write your own programming language after reading about 30% of the dragon book, but I think you can find easier books to get started these days.
Nov 06 2017
On Tuesday, 7 November 2017 at 01:30:14 UTC, Basile B. wrote:On Saturday, 4 November 2017 at 20:28:17 UTC, Ola Fosheim Grøstad wrote:A basic compiler is not so complicated. Just align the semantics of your language to an existing one and use that language as your intermediate representation (C, D, Go whatever).On Saturday, 4 November 2017 at 15:51:30 UTC, Basile B. wrote:I've just read the dragon book. let's write a compilerPeople who say that after reading the dragon book, you will program your own programming language are lying.Well, you most certainly can write your own programming language after reading about 30% of the dragon book, but I think you can find easier books to get started these days.
Nov 07 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?A few more resources on writing a frontend (lexer, syntactic and semantic analizer). http://thinkingeek.com/gcc-tiny/ Tells how to create a GCC frontend for a Pascal-like language, tiny. Can be useful since you can look how it applies to a real dfrontend in GDC. https://ruslanspivak.com/lsbasi-part1/ Very clear tutorial on writing a Pascal interpreter in Python. Very beginner friendly, but not complete yet. http://buildyourownlisp.com/contents It is an online book that teaches C by writing an interpreter for a Lisp-like language, lispy. The code can be easely translated to D. If you want you can also look at some haskell books. A simple parser is one of the standard projects used to teach haskell.
Nov 04 2017
Author Allen Holub has made his out-of-print book, Compiler Design in C, available as a free pdf download: http://holub.com/compiler/ And Torben Mogensen is doing the same with his more recent Basics of Compiler Design: http://www.diku.dk/~torbenm/Basics/
Nov 07 2017
Thanks for those references! I'm also interested in looking through those. I had computation theory in college a long time ago but never took a compiler course. On 11/7/2017 5:26 AM, Tony wrote:Author Allen Holub has made his out-of-print book, Compiler Design in C, available as a free pdf download: http://holub.com/compiler/ And Torben Mogensen is doing the same with his more recent Basics of Compiler Design: http://www.diku.dk/~torbenm/Basics/ --- This email has been checked for viruses by AVG. http://www.avg.com
Nov 09 2017