我搜索并浏览了 Go 网站,但我找不到 Go 非凡的构建时间的解释。它们是语言特性(或缺乏)的产物、高度优化的编译器还是其他什么?我不是要推广 Go。我只是好奇。
最佳答案
依赖分析。
Go FAQ用于包含以下句子:
Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
虽然该短语不再出现在常见问题解答中,但该主题已在讲座 Go at Google 中进行了详细阐述。 ,比较了C/C++和Go的依赖分析方法。
这是快速编译的主要原因。这是设计使然。
关于performance - Go 是如何编译得这么快的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2976630/