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

前端 未结 17 1141
难免孤独
难免孤独 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:51

    Compiler programming is multi-faceted since it includes parsing of code into logical trees and then translating code into another form of code. And potentially analyzing the input once its in trees for optimizations.

    So in a round about way it will help every programmer, because you know how statements can be interpreted faster, or how to write a precompiler to make macros for your language of choice. Or even just how to parse that flat file better than your colleague.

    For most script based languages, which don't have a compiler, you won't be able to optimize your day to day work flow much with learning how to make a compiler. But you will still understand parsing.

提交回复
热议问题