当前位置:网站首页>Specific meaning of go bootstrap

Specific meaning of go bootstrap

2022-06-26 09:46:00 wohu1104

Like many mainstream languages ,Go Language compilers were originally written by C Language and assembly language .C Language and assembly Go compiler ( Write it down as A) Used to compile Go Source file . So here comes the question ?

Whether it can be used Go The language itself implements a Go compiler B , Using compiler A To compile the Go compiler B The source code of the project is linked to the final Go compiler B Well ? This is it. Go The core team is Go 1.5 What you do when you release .

They use most of the original C And compiled Go The compiler and runtime implementation are changed to use Go Language writing , And use Go 1.4.x compiler (C And assembly implementation , amount to A ) Compiled Go 1.5 compiler . So from Go 1.5 Version start ,Go The compiler uses Go Language implementation , This is called bootstrapping . That is, use the target programming language to compile (Go Language ) Write its (Go) compiler .

原网站

版权声明
本文为[wohu1104]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170549209753.html