历史与人物github.com
Dennis Ritchie 的第一版 C 编译器(约 1972 年)
Dennis Ritchie’s first C compiler (c. 1972)
2013 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这个 GitHub 仓库保存了 Dennis Ritchie 约 1972 年编写的最早 C 编译器源码,是 C 语言和 Unix 早期历史的一手材料。浏览源码能直接看到早期编译器的实现方式,以及当时颇为独特的代码排版风格。
为什么经久不衰:它把 C 语言诞生初期的编译器源码原样呈现出来,既是计算机史文物,也能让今天的人理解早期系统软件的写法与局限。
HN 评论精选
作者 1978 年打印 C 编译器源码研究,管理员得知后转而支持。
这勾起了我的回忆:大约 1978 年我刚学编程时,这是我最早能拿来研究的大型程序。我说服人让我用当地大学电子工程系的 11/45,发现源码树就挂载在那里(他们有一台 90MB 的 CDC“洗衣机”硬盘),于是决定用 132 列的 Tally 点阵打印机把它打印出来。打印了几分钟后,系统管理员冲进终端室,生气地问“谁在跑这个大打印任务”。我胆怯地举手。他问我在打印什么,我说是 C 编译器源码,因为我想弄明白它怎么工作。他回答:“哦,那就没问题,需要加纸或换色带就告诉我。”
dboreham查看英文原文
Brings back some memories because this was the first "large" program available to me for study when I was first learning to program, around 1978. Having talked my way into using the local university EE dept's 11/45, I found the source tree was mounted (they had a 90MB CDC "washing machine" drive) and decided to print it out on the 132-col Tally dot-matrix printer. Some minutes into this, the sysadmin bursts into the terminal room, angrily asking "who's running this big print job". I timidly raise my hand. He asks what I'm printing. I tell him the C compiler source code because I want to figure out how it works. He responds "Oh, that's ok then, no problem, let me know if you need more paper loaded or a new ribbon".
早期代码的缩进与 else 排版容易造成难以察觉的错误。
不得不说,这里缩进和括号的写法简直是在邀请隐蔽的 bug。比如这段: if (peekc) { c = peekc; peekc = 0; } else if (eof) return(0); else c = getchar();
amyjess查看英文原文
I have to say, the way indentation and brackets were done here looks like it's just inviting subtle bugs. Take this for example: if (peekc) { c = peekc; peekc = 0; } else if (eof) return(0); else c = getchar();
最早的 C 编译器源码已使用 auto 关键字。
初始版本里就已经有 `auto`。
tirrex查看英文原文
https://github.com/mortdeus/legacy-cc/blob/ccbe90a2803e2cc7e177c77cf1d5c19dd13f6d02/last1120c/cvopt.c#L35 “auto” exists in the initial version.
给出该主题在 HN 上的早期讨论链接。
此前的讨论: https://news.ycombinator.com/item?id=14669709 https://news.ycombinator.com/item?id=5748672
userbinator查看英文原文
Previous discussion: https://news.ycombinator.com/item?id=14669709 https://news.ycombinator.com/item?id=5748672
历次讨论
同类还值得读
开发者无薪坚持完成 Mac 图形计算器:一个秘密项目的故事
Dev stays without pay to finish Mac Graphing Calculator as skunkworks project
苹果 Mac 图形计算器(Graphing Calculator)开发者的亲述:在项目被砍后,几位工程师在没有报酬、没有正式授权的情况下,以“地下项目”方式偷偷留在公司把软件做完…
历史与人物上首页 6 次 · 2009–2022pacifict.com理查德·费曼与 Connection Machine
Richard Feynman and the Connection Machine
长文回忆费曼晚年参与 Connection Machine 并行计算机项目的经历:他分析路由器、用自创的并行 Basic 编写 QCD 程序,也涉足细胞自动机等主题。
历史与人物上首页 5 次 · 2010–2021longnow.org编辑精选负 2000 行代码
-2000 Lines of Code
folklore.org 上 Andy Hertzfeld 记录的一则苹果 Macintosh 开发轶事:Bill Atkinson 被问到写了多少行代码时,回答“-2000 行…
历史与人物上首页 4 次 · 2014–2022folklore.org编辑精选一位破解赛马密码的赌徒
A Gambler Who Cracked the Horse-Racing Code (2018)
彭博社 2018 年的长篇特写,讲述数学家 Bill Benter 如何用统计模型和算法在赛马博彩中持续盈利、累计赢得近十亿美元的故事。
历史与人物上首页 4 次 · 2018–2024bloomberg.comDB-19:复活一个过时的连接器
DB-19: Resurrecting an Obsolete Connector
讲述作者如何为一个已经停产的 DB-19 连接器寻找制造途径,并最终小批量复刻出来。
历史与人物上首页 4 次 · 2016–2024bigmessowires.com