How was the first C compiler written?

后端 未结 3 1354
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 15:27

Is it true that the first C compiler was written in C itself? Then, how was it executed and compiled? Or, was this compiler written in assembly language?

3条回答
  •  悲哀的现实
    2020-12-07 16:22

    It is described pretty well in Dennis Ritchie's writeup of the C language history.

    Giving just a summary of what he wrote there, use his article for the finer details. C started with the BCPL language, Ken Thomson had access to a compiler for it that ran on their General Electrics 635 main frame. Unhappy with the language, Thomson used BCPL to write a compiler for the B language, an evolutionary step beyond BCPL that removed some of the technical problems in BCPL.

    They used B to create programs on their PDP-7 minicomputer, although most of them were little more than toy programs, the machine had very restricted hardware capabilities. One important step taken by Thomson was to rewrite the B compiler in B itself. A common bootstrapping step.

    That compiler was then gradually tweaked, through a short-lived intermediary step called NB (New B) to start resembling C. The PDP-11 minicomputer was instrumental in that step, giving them enough room to improve the language and compiler.

提交回复
热议问题