TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The earliest versions of the first C compiler known to exist

375 点作者 diginova2 个月前

22 条评论

tanelpoder2 个月前
The first publicly available version of Oracle Database (v2 released in 1979) was written in assembly for PDP-11. Then Oracle rewrote v3 in C (1983) for portability across platforms. The mainframes at the time didn't have C compilers, so instead of writing a mainframe-specific database product in a different language (COBOL?), they just wrote a C compiler for mainframes too.
评论 #43461432 未加载
评论 #43469717 未加载
评论 #43468340 未加载
评论 #43463309 未加载
ChrisMarshallNY2 个月前
This is my favorite function :): <a href="https:&#x2F;&#x2F;github.com&#x2F;mortdeus&#x2F;legacy-cc&#x2F;blob&#x2F;936e12cfc756773cb14c56a935a53220b883c429&#x2F;last1120c&#x2F;c10.c#L11" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mortdeus&#x2F;legacy-cc&#x2F;blob&#x2F;936e12cfc756773cb...</a>
评论 #43464896 未加载
评论 #43462947 未加载
评论 #43460102 未加载
keyle2 个月前
Aside: I was playing with Think C [2] yesterday and macOS 6.0.8 (emulated with Mini vMac [1]).<p>Boy it took a lot of code to get a window behaving back in the day... And this is a much more modern B&#x2F;C; it&#x27;s actually ANSI C but the API is thick.<p>I did really enjoy the UX of macOS 6 and it&#x27;s terse look, if you can call it that [3].<p>[1] <a href="https:&#x2F;&#x2F;www.gryphel.com&#x2F;c&#x2F;minivmac&#x2F;start.html" rel="nofollow">https:&#x2F;&#x2F;www.gryphel.com&#x2F;c&#x2F;minivmac&#x2F;start.html</a><p>[2] <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;think_c_5" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;think_c_5</a><p>[3] <a href="https:&#x2F;&#x2F;miro.medium.com&#x2F;v2&#x2F;resize:fit:1024&#x2F;format:webp&#x2F;0*S57C0cBTJnmJCR7N.png" rel="nofollow">https:&#x2F;&#x2F;miro.medium.com&#x2F;v2&#x2F;resize:fit:1024&#x2F;format:webp&#x2F;0*S57...</a>
评论 #43467828 未加载
dark-star2 个月前
My favorite function, which some might say even made it into Windows ;-)<p><pre><code> waste() &#x2F;* waste space *&#x2F; { waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); waste(waste(waste),waste(waste),waste(waste)); }</code></pre>
评论 #43460135 未加载
评论 #43460726 未加载
bluetomcat2 个月前
Interesting usage of &quot;extern&quot; and &quot;auto&quot;. Quite different from contemporary C:<p><pre><code> tree() { extern symbol, block, csym[], ctyp, isn, peeksym, opdope[], build, error, cp[], cmst[], space, ospace, cval, ossiz, exit, errflush, cmsiz; auto op[], opst[20], pp[], prst[20], andflg, o, p, ps, os; ... </code></pre> Looks like &quot;extern&quot; is used to bring global symbols into function scope. Everything looks to be &quot;int&quot; by default. Some array declarations are specifying a size, others are not. Are the &quot;sizeless&quot; arrays meant to be used as pointers only?
评论 #43463169 未加载
评论 #43459491 未加载
评论 #43465567 未加载
评论 #43459558 未加载
评论 #43467091 未加载
评论 #43467215 未加载
评论 #43465304 未加载
ricardo812 个月前
Reminds me of the humility every programmer should have, basically we&#x27;re standing on the shoulders of giants and abstraction for the most part. 80+ years of computer science.<p>Cool kids may talk about memory safety but ultimately someone had to take care of it, either in their code or abstracted out of it.
评论 #43468797 未加载
评论 #43463054 未加载
评论 #43461930 未加载
90s_dev2 个月前
The thing I always loved about C was its simplicity, but in practice it&#x27;s actually very complex with tons of nuance. Are there any low level languages like C that actually <i>are</i> simple, through and through? I looked into Zig and it seems to approach that simplicity, but I have reservations that I can&#x27;t quite put my finger on...
评论 #43462118 未加载
评论 #43461169 未加载
评论 #43461441 未加载
评论 #43461068 未加载
评论 #43461008 未加载
评论 #43464581 未加载
评论 #43461799 未加载
评论 #43467230 未加载
评论 #43461045 未加载
评论 #43468827 未加载
评论 #43464260 未加载
评论 #43462503 未加载
FeistySkink2 个月前
Missed opportunity not calling it LegaC.
smackay2 个月前
1972 is the answer to the question on the lips of everybody too busy to look at the source files.
评论 #43466692 未加载
deweywsu2 个月前
Am I interpreting this repo correctly? The first C compiler was written in...C?
评论 #43462736 未加载
评论 #43462794 未加载
评论 #43465698 未加载
Joker_vD2 个月前
Funnily enough, it is emphatically <i>not</i> a single-pass compiler.
评论 #43463167 未加载
diginova2 个月前
Also read how a compiler can be written in the same language - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bootstrapping_%28compilers%29" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bootstrapping_%28compilers%29</a><p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;18247926&#x2F;15566831" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;18247926&#x2F;15566831</a>
robertkoss2 个月前
As someone who has no touchpoints with lower languages at all, can you explain to me why those files are called c01, c02 etc.?
tempodox2 个月前
Highly interesting!<p><pre><code> main(argc, argv) int argv[]; </code></pre> This is a culture shock. Did the PDP-11 not distinguish between `char` and `int`?
评论 #43461545 未加载
评论 #43461454 未加载
评论 #43492342 未加载
ModernMech2 个月前
I thought the first C compiler was written in B.
评论 #43461370 未加载
评论 #43461182 未加载
评论 #43461039 未加载
ZhiqiangWang2 个月前
Can&#x27;t stop thinking about Ken Thompson Hack. This should be a clean one ...
aap_2 个月前
Probably one of my favorite pieces of software of all times. Learned so much from this!
评论 #43460362 未加载
canucker20162 个月前
Can people who have used&#x2F;were around at this time (early 1970s) give a description of the typical dev environment?<p>Also helpful: C history <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;C_language#History" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;C_language#History</a><p>From wikipedia, early Unix was developed on PDP&#x2F;11 (16-bit).<p>signed 16-bit ints, 8-bit chars, arrays of those previous types.<p>identifiers were limited in length? (I&#x27;m seeing 8 chars, lowercase, as the longest)<p>octal numeric constants, was hexadecimal used?<p>there was only a line editor available (vi was 1976)<p>did the file system support directories at that point?<p>no C preprocessor, no header files. (1973)<p>no make&#x2F;makefiles (1976)<p>was there a std library used with the linker or an archive of object files that was the &#x27;standard&#x27; library?<p>Bourne shell wasn&#x27;t around (1979), so wikipedia seems to point to the Thompson shell - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Thompson_shell" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Thompson_shell</a><p>was there a debugger or was printf the only tool?
评论 #43467252 未加载
andromaton2 个月前
Somebody check for Trojan horses. (Ref to Ken Thompson)
sbassi2 个月前
which compiler is used to compile the first compiler?
评论 #43465617 未加载
ramon1562 个月前
Love how unserious some of the code comments are. Makes you feel less noob for a second :&#x27;)
higgins2 个月前
disappointed this didn&#x27;t link to some analysis of clay tablets