我注意到,前4个版本f6182e5abf5e,b66d0bf8da3e,ac3363d7e788,172d32922e72围棋源都来自很久以前Golang甚至提出,从1972年的最古老的存在.他们也都归功于AWK成名的Brian Kernighan.它们似乎是hello, worldC 中的实现.这是复活节彩蛋还是有一些实际目的?
Von*_*onC 18
那个帖子提到:
敬意,复活节彩蛋,里面的笑话,请你选择:).请注意有关提交的作者
所述线程引用此提交作为起点,但也指出Golang项目的实际第一次提交,以及Go规范的第一次修订.
四个首次提交的(据称)"作者"是Brian Kernighan.
Rob Pike曾在1980年代在贝尔实验室与Brian合作过,所以这可以被视为对他职业起源的参考.
这个复活节彩蛋的想法是Hello World用C 来说明程序的演变:
(最近通过最近的GopherCon 2014 hellogophers.slide年 4月的演讲- Rob Pike了解更多信息)
hg log -r 0:4
changeset: 0:f6182e5abf5e
user: Brian Kernighan <bwk>
date: Tue Jul 18 19:05:45 1972 -0500
summary: hello, world
$ hg update -r 0
$ cat src/pkg/debug/macho/testdata/hello.b
main( ) {
extrn a, b, c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';
Run Code Online (Sandbox Code Playgroud)
changeset: 1:b66d0bf8da3e
user: Brian Kernighan <bwk>
date: Sun Jan 20 01:02:03 1974 -0400
summary: convert to C
$ hg update -r 1
$ cat src/pkg/debug/macho/testdata/hello.c
main() {
printf("hello, world");
}
Run Code Online (Sandbox Code Playgroud)
changeset: 2:ac3363d7e788
user: Brian Kernighan <research!bwk>
date: Fri Apr 01 02:02:04 1988 -0500
summary: convert to Draft-Proposed ANSI C
$ hg update -r 2
$ cat src/pkg/debug/macho/testdata/hello.c
#include <stdio.h>
main()
{
printf("hello, world\n");
}
Run Code Online (Sandbox Code Playgroud)
changeset: 3:172d32922e72
user: Brian Kernighan <bwk@research.att.com>
date: Fri Apr 01 02:03:04 1988 -0500
summary: last-minute fix: convert to ANSI C
$ hg update -r 3
cat src/pkg/debug/macho/testdata/hello.c
#include <stdio.h>
int
main(void)
{
printf("hello, world\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
changeset: 4:4e9a5b095532
user: Robert Griesemer <gri@golang.org>
date: Sun Mar 02 20:47:34 2008 -0800
summary: Go spec starting point.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2381 次 |
| 最近记录: |