November 04, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | 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.
|
November 04, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dr. Assembly | 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. |
November 07, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | 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: >> 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. I've just read the dragon book. let's write a compiler https://imgur.com/1pFeat8 ;-) |
November 07, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | 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:
>> 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.
>
> I've just read the dragon book. let's write a compiler
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).
|
November 07, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dr. Assembly | 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/ |
November 09, 2017 Re: Any book recommendation for writing a compiler? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tony |
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
>
|
Copyright © 1999-2021 by the D Language Foundation