Go编程语言的编译器是用什么语言编写的?
我认为标题是不言自明的。
I think the title is self explanatory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我认为标题是不言自明的。
I think the title is self explanatory.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
编程语言不是程序,因此它们不是用任何语言“编写”的。它们通常用形式语法(例如 BNF)来描述。
编程语言的解释器和编译器都是程序,因此必须用某种编程语言编写。
Go 至少有两个编译器,
gc
和gccgo
。前者是用 C 编写的,但现在是用 Go 本身编写的。而后者是主要用 C++ 编写的 gcc 前端。 Go 的库是用 Go 编写的。Programming languages aren't programs, hence they're not "written" in any language. They are often described by formal grammars (e.g. BNF).
Interpreters and compilers for programming languages are programs and so must be written in some kind of programming language.
Go has at least two compilers,
gc
andgccgo
. The former was written in C, but is now written in Go itself. While the latter is a gcc frontend written mainly in C++. Go's libraries are written in Go.请自行查看源代码和 C,如果我可以这么说的话。
编辑 Go 团队于 2013 年 12 月宣布 他们会将编译器转换为 Go。截至 2015 年 2 月,编译器完全是自托管的,因为 C 实现已删除。新编译器首次随 Go 1.5 一起发布。
Look at the source and C for yourself, if I may say.
EDIT The Go team announced in December 2013 that they will be transitioning the compiler to Go. As of February 2015, the compiler is exclusively self-hosting, as the C implementation was deleted. The new compiler shipped for the first time with Go 1.5.
它是用 C 编写的。库本身是用 Go 编写的。
编辑:现在编译器已用 Go 重写,因此它是完全自托管的。
It's written in C. The libraries are written in Go itself.
Edit: Now the compiler has been rewritten in Go, so it is fully self-hosting.
“go 编译器是用 go 编写的,很少使用汇编语言”
“但是 gccgo 是用 c c++ 和 go 编写的”
Rob Pike
"go compiler written in go and little of assembly"
"but gccgo is written in c c++ and go"
Rob Pike