Is it beneficial for a programmer to learn how to build a compiler?

前端 未结 17 1132
难免孤独
难免孤独 2021-02-07 01:10

There is a lot of variety when it comes to the different types of programmers. In general, is beneficial for a programmer to learn how to build a compiler? In what cases would

17条回答
  •  别那么骄傲
    2021-02-07 01:50

    I am in the process of reading through The Dragon Book (Compilers) and during the beginning of the book you are greeted with the following:

    Although few people are likely to build or even maintain a compiler for a major programming language, the reader can profitably apply the ideas and techniques discussed in this book for general software design. For example, the string matching techniques for building lexical analysers have also been used in text editors, information retrieval systems, and pattern recognition programs. Context-free grammars and syntax-directed definitions have been used to build many little languages such as the typesetting and figure drawing systems that produced this book. The techniques of code optimisation have been used in program verifiers, and in programs that produce "structured" programs from unstructured code.

    In short, you won't just be learning how to build a compiler. You'll be learning many different lower-level techniques along the way to assist you in everyday programming. Although some say it is a dated book I still enjoy it and I would recommend it, even though the reading can get a bit heavy. If you do get it leave a good amount of time to read it and understand it.

提交回复
热议问题