Is it beneficial for a programmer to learn how to

2020-05-31 00:23发布

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 compiler programming be, or not be, needed?

17条回答
可以哭但决不认输i
2楼-- · 2020-05-31 00:30

I think my compiler & language theory course at University really had an enormous influence on my understanding of computer languages, even a decade afterwards. But I'm not really sure I'd need to implement a compiler for this.

查看更多
成全新的幸福
3楼-- · 2020-05-31 00:31

Understanding the process of compilation is a general approach to understanding how the computer works, and therefore provides a broad scope of understanding. Many modern programmers work in complex environments that require little of this understanding, at least on basic levels. An example is java, which hides the linking step of compilation from the developer.

Knowledge is knowledge, it is almost always useful. In my case, I found understanding compilation process exceptionally usefull when doing performance enhancement, which is my job. (I work in a super low latency environment)

If you do all your work in PHP mySql that is great. Just remember that all technologies get outdated, and you will need to understand the next great thing. Having "general knowledge" like understanding compilation provides a conceptional buffer between you and those shmucks who can't adapt.

Learn how to learn.

查看更多
乱世女痞
4楼-- · 2020-05-31 00:32

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.

查看更多
放我归山
5楼-- · 2020-05-31 00:33

While few programmers will ever end up having to implement a compiler, the earlier stages of compiler building, namely lexing and parsing are something that can come up far more often: Who hasn't had to write a parser for some strange file format? Usually, those are simple enough to manage without experience in compiler building, but not always.

查看更多
混吃等死
6楼-- · 2020-05-31 00:34

This is like asking "is it beneficial for a programmer to have more programming knowledge?". The simple is that yes, it is beneficial. How much will it benefit day to day non-compiler-building programing affairs is hard to guess. But it will definitely teach you about how the internals of what you are doing work, how to manipulate strings to dictate logic and possibly help you debug better regardless of what you use.

查看更多
狗以群分
7楼-- · 2020-05-31 00:35

I think, it is better to learn from knowledge point of view. At least you can look into existing compiler source code and understand the typical compilation steps and complexity involved in each phase of compilation.

查看更多
登录 后发表回答