HACKER Q&A
📣 davegauer

Book recommendations for grammar as it relates to computing?


Though any book on compilers or computation will make some reference to grammar (defining terms such as regular vs. non-regular), it is often in passing. I'm interested in a deeper dive. I believe a lot of the terminology we use comes from Chomsky, but his own books seem to be focused on humans and language learning. I'd like a wide survey of the field, but as it relates to making computers do things or encoding information. Oh, and while I'm being wishful, one written in layman's terms.

Is there a "Grammar as it Relates to Computing for Dummies"?


  👤 layer8 Accepted Answer ✓
This might be what you’re looking for: https://www.amazon.com/Parsing-Techniques-Practical-Monograp...

Not exactly cheap, but pretty good.

There’s also https://www.amazon.com/Automata-Formal-Languages-Turing-Mach... which focuses more on the Chomsky hierarchy and automata, and doesn’t go into practical parsers and the related grammar types like the first book.


👤 harrada256
"Compilers: Principles, Techniques, and Tools" or "The Dragon Book" as it is informally known was always recommended on compsci courses I have taken. It has a section within "Syntax Analysis" which covers context-free grammars.

👤 open-source-ux
Does 'Backus–Naur form' meet your interest? It is a formal way of describing the syntax of a programming language, but I suspect it is not used much for modern programming languages:

https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form