惊呆了!Go 代码的第一次提交竟然是 1972 年。。。
2021-07-02 19:12:03 Author: mp.weixin.qq.com(查看原文) 阅读量:56 收藏

阅读本文大概需要 5 分钟。

大家好,我是 polarisxu。

网友们真的是很强大,竟然发现 Go 代码仓库中第一次发生在 1972 年,提交者是 Brian Kernighan。他是 《C 语言程序设计》 和 《Go 语言程序设计》这两本书的作者之一(都号称是圣经)。

你可以通过这个地址查看:https://github.com/golang/go/commit/7d7c6a97f8 (点击文末「阅读原文」可直达)。从文件后缀看,是 B 语言的 Hello World 程序(B 语言是 Ken 发明的)。

顺着这个,我查看了 Go 仓库最早的几次提交记录:

$ git log --reverse
commit 7d7c6a97f815e9279d08cfaea7d5efb5e90695a8
Author: Brian Kernighan <bwk>
Date:   Tue Jul 18 19:05:45 1972 -0500

    hello, world

    R=ken
    DELTA=7  (7 added, 0 deleted, 0 changed)

commit 0bb0b61d6a85b2a1a33dcbc418089656f2754d32
Author: Brian Kernighan <bwk>
Date:   Sun Jan 20 01:02:03 1974 -0400

    convert to C

    R=dmr
    DELTA=6  (0 added, 3 deleted, 3 changed)

commit 0744ac969119db8a0ad3253951d375eb77cfce9e
Author: Brian Kernighan <research!bwk>
Date:   Fri Apr 1 02:02:04 1988 -0500

    convert to Draft-Proposed ANSI C

    R=dmr
    DELTA=5  (2 added, 0 deleted, 3 changed)

commit d82b11e4a46307f1f1415024f33263e819c222b8
Author: Brian Kernighan <[email protected]>
Date:   Fri Apr 1 02:03:04 1988 -0500

    last-minute fix: convert to ANSI C

    R=dmr
    DELTA=3  (2 added, 0 deleted, 1 changed)

commit 18c5b488a3b2e218c0e0cf2a7d4820d9da93a554
Author: Robert Griesemer <[email protected]>
Date:   Sun Mar 2 20:47:34 2008 -0800

    Go spec starting point.

1974 年,Brian Kernighan 将 B 语言的 Hello World 改为 C 语言实现;1988 年,他又将 Hello World 改为 ANSI C 实现。通过 https://github.com/golang/go/commit/ 加上对应提交的 hash 值,可以在浏览器方便看到具体的改变,同时还有网友在这些提交下面的评论,比如:

一般认为,Hello World 最早出现在 Brian Kernigham 在 1972 年发布的《 B 语言简介教程(A Tutorial Introduction to the Language B)》中,而 Go 代码中的第一次提交正好是 1972 年。在那以后,Hello World 还被用于 1974 年的贝尔实验室备忘录,以及 1987 年他的《 C 语言程序设计(The C Programming Language)》一书。从此 Hello World 成为了编程语言的第一个示例程序。(这些时间点和上面 Go 代码的提交时间点一致)。

没想到,Go 代码仓库中竟然记录下了各种历史性的时刻,大概率是 Go 作者们保存下来的,毕竟他们几个都是贝尔实验的。

之后的 Sun Mar 2 20:47:34 2008 才真正是 Go 的开始。

挖掘一些 Go 的趣事,祝大家周末愉快!


往期推荐

我是 polarisxu,北大硕士毕业,曾在 360 等知名互联网公司工作,10多年技术研发与架构经验!2012 年接触 Go 语言并创建了 Go 语言中文网!著有《Go语言编程之旅》、开源图书《Go语言标准库》等。

坚持输出技术(包括 Go、Rust 等技术)、职场心得和创业感悟!欢迎关注「polarisxu」一起成长!也欢迎加我微信好友交流:gopherstudio


文章来源: http://mp.weixin.qq.com/s?__biz=MzAxNzY0NDE3NA==&mid=2247487546&idx=1&sn=6a55fa267405f0cdf781686dafed55fa&chksm=9be33fdbac94b6cd7f5ce92db67f29eb271c543dc7fa889cd3baf7f6dfcc89e470927fd735d3#rd
如有侵权请联系:admin#unsafe.sh