Re:Ask HN: What are the best books on creating a programming...
by e19293001 on Monday December 07, 2015 @07:08PM
(#10693822)
Compiler Construction Using Java, JavaCC, and Yacc, IEEE/Wiley, 2012
This book taught me how to create compilers. The author started from simple principles in grammars then slowly introducing a very simple compiler eventually adding more features to the compiler. I was able to adapt his method in developing a compiler. In later chapters, the book does a great job in presenting an application of what was learned from the previous chapters by implementing grep using automata theory.
I haven't read a lot of language books, but this one has good information on the various design choices one might make when building a language. Like the others listed in the comments, it's more implementation-focused than semantic design-focused.
Re:Ask HN: What are the best books on creating a programming...
by sdegutis on Sunday December 06, 2015 @10:52AM
(#10685516)
Huh. This is the only book recommended so far that only has good Amazon reviews. I think it may be a winner. But honestly it's so hard to judge a book by its cover, or even by Amazon reviews (even though some of them seem to make really good points).
Re:Ask HN: What are the best books on creating a programming...
by woolybully on Saturday December 05, 2015 @10:31AM
(#10682137)
Well, there's designing a pl and there's implementing a pl, and many other subquestions as well. For implementation, yes, the Dragon book is fundamental, but also look at other points of view, such as packrat parsing, or non-textual syntax. For design, wow, hmm, does the world need another programming language? If you're thinking of an OO language, look at the design space of OO languages, for example, is inheritance class-based or prototype-based. if you're looking outside OO languages, look at the crazy menagerie of languages that have been created so far: APL, Plankalkul, Toontalk.
Re:Ask HN: What are the best books on creating a programming...
by Ace17 on Saturday December 05, 2015 @02:33AM
(#10681211)
For the actual implementation of a compiler (not design of the language itself), I'd recommend "Modern Compiler Design" by Dick Grune.
A lot more practical and readable than the Dragon Book.
Re:Ask HN: What are the best books on creating a programming...
by sdegutis on Saturday December 05, 2015 @03:51PM
(#10683234)
The Amazon reviews on Modern Compiler Design aren't very favorable towards it. Same for the Dragon books (all editions). I'm not sure what to make of this.
Re:Ask HN: What are the best books on creating a programming...
by sdegutis on Saturday December 05, 2015 @10:08AM
(#10682068)
The dragon book is mentioned often, but usually only as "this book covers these things," which isn't really a recommendation, only a comment. Is the book actually good? Can you recommend it?
Re:Ask HN: What are the best books on creating a programming...
by wbsun on Sunday December 06, 2015 @12:39AM
(#10684500)
Yes, it is a great book. Trust me. If you are scared by the lexing and parsing algorithms, skip them because it is highly unlikely you will write them on your own. You don't need to refer to other sources to implement your own language with it.
Re:Ask HN: What are the best books on creating a programming...
by sova on Saturday December 05, 2015 @06:50PM
(#10683764)
Learn Lisp. Or the more modern equivalent: Clojure. I think learning a LISP-like language will make programming at its core that much more clear, and the potential for a DSL (domain specific [programming] language) that much more relevant.
Re:Ask HN: What are the best books on creating a programming...
by sdegutis on Sunday December 06, 2015 @10:50AM
(#10685508)
Thanks for the tip. I've been doing Clojure full time for about 4 years now, so I think I've got a good head-start. Now I'm looking for something that will help me understand stacks in virtual machines and how to generate bytecode for them from an AST, that kind of thing.
Re:Ask HN: What are the best books on creating a programming...
by e19293001 on Tuesday December 08, 2015 @09:31AM
(#10696490)
The book that I've recommend will also help you understand what you mentioned. I had a great time going through the book, enjoyed a lot and learned a lot. Really.
This book taught me how to create compilers. The author started from simple principles in grammars then slowly introducing a very simple compiler eventually adding more features to the compiler. I was able to adapt his method in developing a compiler. In later chapters, the book does a great job in presenting an application of what was learned from the previous chapters by implementing grep using automata theory.
http://www.amazon.com/Programming-Language-Pragmatics-Third-...
I haven't read a lot of language books, but this one has good information on the various design choices one might make when building a language. Like the others listed in the comments, it's more implementation-focused than semantic design-focused.
About the language design itself, you might want to have a look to: http://www.drdobbs.com/architecture-and-design/so-you-want-t... These are very interesting guidelines from Walter Bright, the man behind the D programming language.
http://www.amazon.com/Compilers-Principles-Techniques-Tools-...
You can also use http://lmgtfy.com/?q=sicp for a deeper understanding of interpreted languages and language structure.
The first edition can be had for $10 on amazon. http://www.amazon.com/gp/offer-listing/0201100886/ref=dp_olp...
I usually find then to be cheaper, in paperback, and sometimes with different exercise problems.
Engineering a compiler by Cooper and Torczon.