how golang build itself?
"
The first go compilers were not written in Go.
Once the compiler for go was stable, they used the newest stable version and converted all their compiler's code to go, then they used the newest compiler to compile the next version, so it was compiling itself.
It is called self-bootstrapping. A lot of languages do it. Even Java is written at least somewhat in Java! This is often used as a way to try and prove a language is theoretically turing complete, because it is able to build itself.
The very first compiler for anything would have been written in assembly or machine code. The very first assembler would have been machine code. Once that was out the way you could just reuse stuff.
It is like using a crane to build a crane. Once you have the first crane up you can use it to build more of them.
"
Like lisp, it keeps a theoretically turing complete.
But, in my own view, there are some problems that existed.I took a test for python and golang "hello world"(~0.025s vs ~0.06s in my 12th i5 machine).
If golang keep self-bootstrapping, one day it may be very heavy.
标签:code,golang,how,itself,build,compiler,first From: https://www.cnblogs.com/qianxinn/p/17172067.html