Why are compilers so stupid?

前端 未结 29 1768
借酒劲吻你
借酒劲吻你 2020-11-29 18:07

I always wonder why compilers can\'t figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit

29条回答
  •  有刺的猬
    2020-11-29 18:33

    Because we're just not there yet. You could just as easily have asked, "why do I still need to write programs... why can't I just feed in the requirements document and have the computer write the application for me?"

    Compiler writers spend time on the little things, because those are the types of things that application programmers tend to miss.

    Also, they cannot assume too much (maybe your loop was some kind of ghetto time delay or something)?

提交回复
热议问题