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.
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).
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.
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.
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.
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?
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.
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.
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.
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.