为什么 Go 1.5 要用 Go 重新写 compiler ?

2015-08-20 17:09:57 +08:00
 wuruxu

今天看到 Go1.5 全部采用 Go lang 重新写了。
为什么抛弃 C, 是不是这样更快点?这样做法有什么优势吗?

3981 次点击
所在节点    Go 编程语言
46 条回复
sablib
2015-08-20 17:29:54 +08:00
为了实现自举吧。
wakemecn
2015-08-20 17:43:54 +08:00
我今天第一次下载 go 就用了新版==
tabris17
2015-08-20 17:45:07 +08:00
为了逼格,向 C 致敬
Bown
2015-08-20 17:49:43 +08:00
- It is easier to write correct Go code than to write correct C code.
- It is easier to debug incorrect Go code than to debug incorrect C code.
- Work on a Go compiler necessarily requires a good understanding of Go. Implementing the compiler in C adds an unnecessary second requirement.
- Go makes parallel execution trivial compared to C.
- Go has better standard support than C for modularity, for automated rewriting, for unit testing, and for profiling.
- Go is much more fun to use than C.

https://docs.google.com/document/d/1P3BLR31VA8cvLJLfMibSuTdwTuF7WWLux71CYD0eeD8/edit
chmlai
2015-08-20 18:03:51 +08:00
自举
vipygd
2015-08-20 19:41:08 +08:00
自举
windyboy
2015-08-20 19:48:19 +08:00
我只能说真的强悍
yakczh
2015-08-20 19:56:37 +08:00
为啥 perl6 自举失败了
oska874
2015-08-20 20:01:20 +08:00
以前不举,现在终于硬了。
hooluupog
2015-08-20 20:07:59 +08:00
loading
2015-08-20 20:15:28 +08:00
go 很早就完成自举了,不是新鲜事!
songjiaxin2008
2015-08-20 20:16:13 +08:00
先有鸡先有蛋的问题吗
lujiajing1126
2015-08-20 20:27:21 +08:00
实现自举
janxin
2015-08-20 20:35:37 +08:00
为了自举。就是信仰
echo1937
2015-08-20 20:38:55 +08:00
其实自举的语言太多了, C 干过, C 艹干过, Java 干过, rust 干过, Python 的 Pypy 也干过,不少见。
mathgl
2015-08-20 21:17:18 +08:00
@yakczh perl6 改东西太多,自己挖坑,一头掉下去了。
undeflife
2015-08-20 22:00:21 +08:00
@loading 用 Go 重新写 Compiler 才能叫自举(bootstrapping ) 你所谓的早就完成是什么意思?
timothyye
2015-08-20 22:04:06 +08:00
自举是一种信仰,哈哈
realpg
2015-08-20 22:10:41 +08:00
一直觉得自举就是为了那啥而那啥

用汇编写个编译器才是王道……

你编译这个编译器用的还不是 C 写的编译器 6
phx13ye
2015-08-20 22:39:31 +08:00
bootstrap

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/214606

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX