How do C/C++ compilers work?

后端 未结 10 1690
旧时难觅i
旧时难觅i 2020-12-12 13:02

After over a decade of C/C++ coding, I\'ve noticed the following pattern - very good programmers tend to have detailed knowledge of the innards of the compiler.

I\'

10条回答
  •  盖世英雄少女心
    2020-12-12 13:57

    It may also be valuable to pick up and read the source code to a compiler. I doubt that GCC is the best first choice, since it is burdened with full compatibility to more than 20 years of evolution of the language. But I'm also sure that a reading of its source, guided by one of the internal reference manuals, would be educational.

    I'd seriously consider looking at the source to a scripting language that is internally compiled to a bytecode for a virtual machine. Several languages fit that description, but I would start with Lua. The language is small, and the VM is novel. The source code is also small and the bits I've looked at have been very clear although lightly commented.

提交回复
热议问题