HackerURLs

一次又一次被重新发现的经典。

同一个链接,相隔一年以上,一次又一次被人重新发现、再次冲上 Hacker News 首页。能经受住这种时间检验的,大多是值得一读再读的文章。每篇附中文标题,讨论最热的那些再加上中文导读和高赞评论翻译。

从名人堂开始
  • 4,700+篇经过时间检验的经典

Hall of fame

名人堂

在经典库里看全部精选

上首页次数最多、而且有中文导读的 30 篇。时间轴上每个黑点是一次上首页,空心点是一次没冲上去的投稿。

  1. 正在载入经典…

Archive

经典库

按第一次上首页的年份分布,点柱子筛选。

排序

    About

    这些经典是怎么挑出来的

    1. 01

      合并同一个链接

      读取 Hacker News 自 2006 年以来的全部链接投稿,把 http/https、www、跟踪参数等写法不同的同一篇文章合并成一条。

    2. 02

      只留经得起时间的

      同一链接至少两次拿到 50 分以上(约等于上首页),而且两次相隔一年以上;再由 AI 剔除状态页、产品首页和新闻事件。

    3. 03

      写导读、译评论

      上首页次数最多的 2,000 篇配上中文导读、"为什么经久不衰",并精选翻译 HN 高赞评论。导读由 AI 生成,可能有误。

    工具与资源c9x.me

    QBE:一个新的编译器后端

    Show HN: QBE – a new compiler back end

    3次上首页
    8年跨度
    392累计得分
    105条评论

    2016 — 2024,它一次次回到首页

    黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。

    导读

    QBE 是一个用纯 C 写成、可嵌入的编译器后端:它定义了一套中间语言,负责 SSA 构造、优化和寄存器分配等后端工作,让写新语言的人不必自己处理后端,也不必背上 LLVM 的体量。作者的目标是用大约 10% 的代码量拿到高级编译器约 70% 的性能。

    为什么经久不衰:它证明了“小而可读的编译器后端”这条路可行,多年来一直是 hobby 语言项目和编译器教学里最常被翻出来的参照实现之一。

    关键词 编译器后端QBESSA轻量级工具

    HN 评论精选

    反驳原文对 LLVM 栈槽的批评:栈槽是为可能逃逸的变量准备的,不逃逸的会被 mem2reg 提升为 SSA。

    “实现 SSA 构造很难,为了让用户不必自己实现,LLVM 提供了栈槽,于是一次 `v++` 会被拆成 load、add、store 三条指令”——这个说法是错的。LLVM 提供栈槽有正当理由:分配在栈上的变量可能逃逸,你总得有一块内存放它。如果 mem2reg 能证明该栈变量不逃逸,它就会被提升为 SSA 值。

    munin查看英文原文

    > Implementing SSA construction is hard. To save its users from having to implement it, LLVM provides stack slots. This means that one increment of a variable v will be composed of three LLVM instructions: one load, one add, and one store. This is just wrong, though! LLVM provides stack slots for a good reason: stack allocated variables can escape. You need a place in memory to stick them. If mem2reg can prove that the stack allocated variable doesn't escape, it gets promoted into an SSA value.

    赞赏“极小代码量换大部分能力”的设计哲学,并类比 vis 编辑器。

    很棒的想法!作为编译器从业者我很期待看到它的实际效果。QBE 的理念——“纯 C、可嵌入,用 10% 的代码提供高级编译器 70% 的性能”——和 vis 编辑器很像(用 1% 的代码实现 vim 80% 的功能)。希望这类项目越来越多;我对更简单的程序和生态很感兴趣,哪怕代价是功能更少。

    gnuvince查看英文原文

    This is a wonderful idea! As a compiler person, I'm excited to see how well this works and wish you all the success in the world. > QBE aims to be a pure C embeddable backend that provides 70% of the performance of advanced compilers in 10% of the code. This philosophy is very similar to that of vis [1], a vim-like editor that aims to have 80% of vim's functionality in 1% of the code. I hope that more such project see the light of the day; I'm very interested in simpler programs and simpler ecosystems, even if that comes at the cost of features. [1] https://github.com/martanne/vis

    建议趁项目小而简单时引入契约式设计、静态分析等高保障手段来提升正确性。

    有趣的项目。我特别喜欢文档里讲优化的部分,尤其是那些能拿下最初 70% 收益的优化;我一直建议做优化的人去综述各种方法,找出能带来最大收益的最小集合,这能帮新编译器和形式验证社区起步。回到正确性:项目追求小、简单、严谨,这正是引入高保障方法的好时机——建议试试契约式设计加接口检查、静态分析工具,甚至 Softbound+CETS 这类自动让 C 更安全的东西;我也常建议用 OCaml 写编译器以减少 bug。或者干脆用安全语言和可移植 C 各写一份实现并行测试。

    nickpsecurity查看英文原文

    Interesting project mpu. I like the stuff here: http://c9x.me/compile/doc/llvm.html Especially the optimizations that get you the first 70%. I've been asking optimization people as I see them to do a survey of various methods to find the smallest collection that provide the hugest benefit. This will help people writing new compilers and formal verification community get a head start. Now, back to correctness. Your project aims to be small, simple, and rigorous. That's perfect time to use methods for higher assurance software or design yours to work with them easily. So, I suggest trying Design-by-Contract w/ interface checks, some static analysis tools, or even something like Softbound+CETS that makes C safer automatically. I also usually recommend writing compilers in something like Ocaml as it prevents lots of bugs and easier to do. Also, if you do Ocaml or safe imperative, you can always do two implementations side-by-side in the safe language and in portable C. You run tests, analysis, etc available for each one. Problems in one might be problems in the other. Regardless, though, you get the benefits of the safer language by default with a C implementation if you absolutely need it. Many of us have used this with Sandia Labs even doing it for hardware with ML and hardware language of a Java processor that came out great. So, I challenge you to try to push the envelope by using some available techniques and tools to boost the assurance of your code. Preferably getting it off C, too, due to all the errors it (esp pointers) introduce into the compilers.

    历次讨论

    同类还值得读

    1. 直接在浏览器中启动 Linux 内核

      Boot a linux kernel right inside your browser.

      Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。

      工具与资源上首页 5 次 · 2011–2025bellard.org
    2. Hacker News 未公开功能与行为清单(2018)

      A List of Hacker News's Undocumented Features and Behaviors (2018)

      数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。

      工具与资源上首页 5 次 · 2019–2025github.com
    3. MapSCII:在终端中用盲文和 ASCII 渲染地图

      MapSCII – Braille and ASCII map renderer for the console

      MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。

      工具与资源上首页 5 次 · 2017–2025github.com
    4. 顶尖大学的免费在线课程

      Free Online Courses from Top Universities

      Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。

      工具与资源上首页 5 次 · 2010–2022openculture.com
    5. 淘气字符串:容易引发用户输入问题的字符串清单

      Naughty Strings: A list of strings likely to cause issues as user-input data

      一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。

      工具与资源上首页 4 次 · 2015–2020github.com

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。