2025-09-22

41 篇热帖

1. Cloudflare is sponsoring Ladybird and Omarchy (blog.cloudflare.com)

We are excited to announce our support of two independent, open source projects: Ladybird, an ambitious project to build a completely independent browser from the ground up, and Omarchy, an opinionated Arch Linux setup for developers.

2. How I, a beginner developer, read the tutorial you, a developer, wrote for me (anniemueller.com)

“Hello! I am a developer. Here is my relevant experience: I code in Hoobijag and sometimes jabbernocks and of course ABCDE++++ (but never ABCDE+/^+ are you kidding? ha!)  and I...

3. You did this with an AI and you do not understand what you're doing here (hackerone.com)

cURL漏洞摘要

核心漏洞信息:该报告披露了一个在cURL的cookie解析机制中发现的严重栈缓冲区溢出漏洞。该漏洞可能被利用以实现远程代码执行

漏洞位置:漏洞产生于libcurl处理恶意构造的HTTP Cookie的过程中。

影响范围:所有使用libcurl进行HTTP请求的应用程序均受影响。

5. Cap'n Web: a new RPC system for browsers and web servers (blog.cloudflare.com)

Cap'n Web 是一个全新的远程过程调用(RPC)系统,专为浏览器和 Web 服务器设计,由 Cloudflare 用纯 TypeScript 实现。

核心特性与理念

  • 对象能力模型:这是其最核心的特点。它支持双向调用(客户端和服务器可互相调用对方的方法)、按引用传递函数和对象(传递的函数或 RpcTarget 类实例会转化为远端桩,调用时实际回调原位置),以及Promise 流水线(允许链式调用,整个过程只需一次网络往返)。
  • 面向 Web 栈:不同于 Cap'n Proto,它无需模式定义,几乎无样板代码。底层序列化使用人类可读的 JSON(经特殊预处理)。
  • 简洁易用:客户端和服务器端代码极简,通常只需几行。它提供 WebSocket、HTTP 批量模式等多种传输方式,并内置 TypeScript 支持,可声明接口实现端到端类型检查。
  • 轻量且通用:压缩后小于 10 kB,无依赖,适用于所有主流浏览器、Cloudflare Workers 和 Node.js 等环境。

关键功能与优势

  • 安全模式:通过返回特定对象(如认证后的会话对象)来自然地管理权限,客户端无法伪造该对象。
  • Promise 流水线与数组处理:不仅能流水线化调用,还能在流水线上处理数组(如 .map()),将客户端的回调逻辑转换为服务器端可执行的指令,整个过程仍为单次网络往返,从而能替代部分 GraphQL 的复杂查询需求。
  • 对比 GraphQL:解决了 REST 的“瀑布流”问题,但无需引入新的查询语言或生态。它基于 JavaScript 原生语法,通过对象引用和流水线提供更强的交互建模能力。

技术实现

  • 序列化:基于 JSON,使用特殊数组编码来表示 Date 等特殊类型以及 RPC 引用。
  • 协议:是对称的,双方通过消息流交换消息。每方维护导出表(本地对象)和导入表(远端引用)。通过 push(发起调用/传递引用)和 pull(请求结果)等消息机制实现流水线,正 ID 用于预测调用结果。

适用场景与现状 特别适用于具有实时协作功能的交互式 Web 应用以及需要复杂安全边界建模的场景。目前仍处于实验阶段,但已被 Cloudflare 用于其 Wrangler 的“远程绑定”功能。项目已开源。

6. Sj.h: A tiny little JSON parsing library in ~150 lines of C99 (github.com)

sj.h 是一个极简的 JSON 解析库,用约 150 行 C99 代码实现。

核心特性:

  • 轻量级:仅约 150 行 C99 代码。
  • 零内存分配:采用最小化状态管理,不进行动态内存分配。
  • 错误报告:提供带 行:列 位置信息的错误消息。
  • 功能限制:不包含数字解析(需自行使用 strtodatoi 处理),也不包含字符串解析(需自行处理 Unicode 代理对等)。

使用示例(从 JSON 字符串解析一个矩形结构体):

  1. 定义数据结构(例如 Rect 结构体)和用于比较字符串值的辅助函数 eq
  2. 使用 sj_reader 创建读取器实例。
  3. 调用 sj_read 读取 JSON 文本。
  4. 使用 sj_iter_object 遍历 JSON 对象的键值对。
  5. 在循环中根据键名(如 "x", "y")解析对应的值(使用 atoi 等将字符串转换为整数),并填充目标结构体。

许可:该库在公共领域发布。

7. Why haven't local-first apps become popular? (marcobambini.substack.com)

Offline-first apps promise instant loading and privacy, but in practice, very few apps get offline support because getting sync right is surprisingly hard.

8. PlanetScale for Postgres is now GA (planetscale.com)

PlanetScale for Postgres is now generally available.

10. Kmart's use of facial recognition to tackle refund fraud unlawful (www.oaic.gov.au)

The Privacy Commissioner has found that Kmart breached Australians’ privacy by collecting their personal and sensitive information through a facial recognition technology system.

11. UK Millionaire exodus did not occur, study reveals (taxjustice.net)

The number of millionaires widely reported in the news to be leaving countries in "exodus" represented near-0% of all millionaires.

12. Beyond the Front Page: A Personal Guide to Hacker News (hsu.cy)

HN should be treated as an external comment section for the internet to the extent that it can’t substitute for the internet, much less for your own thinking. At its best, HN is a map to new questions and a window onto new angles. The landscape itself remains elsewhere.

13. Tell the EU: Don't Break Encryption with "Chat Control" (www.mozillafoundation.org)

The EU’s Chat Control law would scan private messages and weaken encryption. Sign Mozilla Foundation’s petition to defend privacy and protect our digital future.

14. I'm spoiled by Apple Silicon but still love Framework (simonhartcher.com)

A personal comparison of battery life between my MacBook M1 Pro and Framework 13

15. A New Internet Business Model? (blog.cloudflare.com)

Cloudflare launched 15 years ago this week. We like to celebrate our birthday by launching new products that give back to the Internet, which will do a lot of this week. But on this occasion we've also been thinking a lot about what's changed on the Internet and what has not.

16. South Korea's President says US investment demands would spark financial crisis (www.cnbc.com)

韩国总统警告:美国投资要求或将引发金融危机

贸易谈判核心分歧

韩国总统李在明表示,若在缺乏保障措施的情况下接受美国当前在贸易谈判中的要求,韩国经济可能面临类似1997年金融危机的动荡。双方于7月口头达成协议,美国降低对韩商品关税,作为交换,韩国需向美国投资3500亿美元,但具体条款尚未书面落实。

李在明指出,主要争议点在于投资执行方式。美方要求韩方直接提取3500亿美元现金在美投资,而韩国希望与美国签订货币互换协议以减少汇率冲击。李在明警告,若按美方条件执行,将严重冲击韩国金融市场。

韩国与日本的差异

韩国提议设立货币互换线以缓冲投资对韩元的影响。李在明强调,韩国与日本情况不同:日本的外汇储备超过韩国的两倍,且拥有国际货币日元及与美国的互换协议。美国商务部长此前敦促韩国参照日美协议,但李在明坚持韩美关系特殊性,需寻找更合理的方案。

商业可行性与控制权之争

双方虽书面同意投资项目需具商业可行性,但细节谈判陷入僵局。美方希望特朗普亲自遴选并掌控投资项目,而韩方在7月已提出“商业可行性项目筛选机制”作为风险防控。李在明认为,如何确保商业合理性是谈判最大的障碍。

现代工厂移民事件

针对8月底美国移民执法部门在佐治亚州现代电池厂逮捕300多名韩国工人一事,李在明批评执法方式“严苛”,但表示理解并非特朗普有意为之。他感谢特朗普允许工人留美的决定,并指出美方已道歉,双方正就合理解决措施进行磋商。该事件虽引发韩企对美投资的担忧,但未动摇美韩同盟。

朝核与地缘政治格局

李在明对朝鲜半岛局势持谨慎态度,认为当前朝韩对话前景不乐观。他鼓励特朗普下月在亚太经合组织峰会期间尝试与金正恩会面,但指出目前美朝并无实质性接触。

对于朝俄军事合作,李在明认为这对韩国安全构成重大威胁,但主张通过对话协调应对。他观察到当前国际阵营对立加剧,韩国地处“社会主义阵营”与“资本主义民主阵营”交界前沿,呼吁寻找缓解军事紧张、实现和平共存的出路。

访美议程

李在明将于本周前往纽约出席联合国大会,并成为首位主持安理会会议的韩国总统。其办公室表示此次行程未安排与特朗普会晤,贸易谈判也不在议程之内。

18. Easy Forth (2015) (skilldrick.github.io)

《Easy Forth》教程总结

核心概念与语法

  • 栈(Stack)为中心:Forth 的核心数据结构是栈,所有操作基于栈进行。数字直接入栈,运算符从栈顶取操作数,结果压栈。
  • 逆波兰表示法(RPN):运算符后置,例如 5 2 + 10 * 计算 (5+2)*10,无需括号,运算顺序由书写顺序决定。
  • 词(Word)与字典:代码由空格分隔的“词”组成。词可以是内置命令、数字或用户自定义词。定义新词使用 : 定义名 ... ;
  • 栈效应注释:用 ( before -- after ) 表示词对栈的影响,例如 +( n1 n2 -- sum )

基础操作

  • 栈操作词
    • dup:复制栈顶元素。
    • drop:丢弃栈顶元素。
    • swap:交换栈顶两元素。
    • over:复制次栈顶元素到栈顶。
    • rot:旋转栈顶三个元素。
  • 输出词
    • .:输出栈顶数字并弹出。
    • emit:将栈顶数字作为 ASCII 字符输出。
    • cr:输出换行。
    • .":在定义内输出字符串。
  • 变量与常量
    • variable name:定义变量,使用 ! 存储值,@ 取值,? 打印值。
    • value constant name:定义常量,直接代表其值。
  • 数组:通过 allot 分配连续内存,使用偏移量计算地址访问元素。

流程控制

  • 布尔值0 为假,非 0(通常 -1)为真。比较运算符如 =<> 返回布尔值。
  • 条件语句:仅能在定义内使用。
    • if ... then
    • if ... else ... then
  • 循环语句
    • do ... loop:计数循环,索引可通过 i 获取。
    • begin ... until:条件循环,当栈顶为真时继续循环。
  • 键盘输入key 阻塞等待按键并返回键码。

综合应用示例:贪吃蛇游戏

教程最后实现了一个完整的贪吃蛇游戏,展示了如何综合运用上述概念。代码结构如下:

  1. 变量与常量定义:存储蛇身坐标、苹果位置、方向、长度等。
  2. 非标准扩展
    • graphics:内存映射的 24x24 像素画布。
    • last-key:非阻塞键盘输入。
    • randomsleep:随机数生成和延时。
  3. 游戏逻辑词
    • initialize:初始化游戏画面、蛇和苹果。
    • move-snake-headmove-snake-tail:移动蛇身。
    • check-input:处理键盘输入改变方向。
    • check-apple:检测是否吃到苹果并增长蛇身。
    • check-collision:检测碰撞(撞墙或自身)。
    • draw-snakedraw-apple:绘制画面。
    • game-loop:主循环,依次调用上述逻辑,直到碰撞结束。
    • start:启动游戏的入口。

此示例演示了 Forth 通过自定义词和组合基本操作来构建复杂程序的能力。

20. We Politely Insist: Your LLM Must Learn the Persian Art of Taarof (arxiv.org)

Abstract page for arXiv paper 2509.01035: We Politely Insist: Your LLM Must Learn the Persian Art of Taarof

21. Is a movie prop the ultimate laptop bag? (blog.jgc.org)

A while back I attended a Cloudflare board meeting  and carried my laptop in a brown paper bag from a grocery store. This elicited a few com...

22. Why is Venus hell and Earth an Eden? (www.quantamagazine.org)

A team of scientists has investigated how Earth’s twin became so inhospitable, and whether the same will happen to our planet.

23. How can I influence others without manipulating them? (andiroberts.com)

This guide explains how to influence others without manipulating them. It introduces five respectful approaches to persuasion that build trust, commitment and genuine buy-in.

We influence others every day, whether we intend to or not. Sometimes it is through the way we argue, sometimes through the way we listen, and sometimes simply through the story we

25. Apple Silicon GPU Support in Mojo (forum.modular.com)

The latest nightly releases of Mojo (and our next stable release) include initial support for a new accelerator architecture: Apple Silicon GPUs! We know that one of the biggest barriers to programming GPUs is access to&hellip;

27. Tesla coast-to-coast FSD crashes after 60 miles (electrek.co)

A duo of Tesla shareholder-influencers tried to complete Elon Musk’s coast-to-coast self-driving ride that he claimed Tesla would be able...

28. Show HN: Software Freelancers Contract Template (sopimusgeneraattori.ohjelmistofriikit.fi)

Generate professional freelancer contracts in minutes. Fill out the form and get a customized PDF contract template for your freelance work.

29. Lightweight, highly accurate line and paragraph detection (arxiv.org)

Abstract page for arXiv paper 2203.09638: Unified Line and Paragraph Detection by Graph Convolutional Networks

30. CompileBench: Can AI Compile 22-year-old Code? (quesma.com)

We tested 19 LLMs on their ability to handle real-world software engineering tasks like compiling old code and cross-compiling. See how Anthropic, OpenAI, and Google models stack up in our new benchmark – CompileBench.

31. Xcode Is the Worst Piece of Professional Software I Have Ever Used (holdtherobot.com)

A developer's lament about Xcode's opaque errors, unreadable project files, and Apple's culture of pretending everything is fine.

32. California bans masks meant to hide law enforcement officers' identities (www.npr.org)

加州州长纽森签署《禁止秘密警察法案》,禁止执法人员在执勤时佩戴口罩(防暴装备、医疗口罩及卧底工作除外)。该法是全美首部此类立法,旨在应对特朗普政府加强移民执法时出现的联邦探员戴面具拘留民众的现象,纽森称此做法意在“恐吓多元化社区”并缺乏透明度。法律将于明年生效,但其对联邦执法人员的约束力可能需由法院裁定,涉及州权与联邦权力的界限问题。加州大学戴维斯分校法律教授指出,该法试图为联邦行动在州内设定限制。纽约州和马萨诸塞州等也在考虑类似立法。

ICE未直接回应,但通常以保护探员安全为由支持佩戴口罩。加州多个执法机构反对该法,称其“不顾及警员及家人安全”;里弗赛德县警长批评立法者更关心罪犯而非警员。民权组织认为,尽管可能存在执行难度,该法将为抵制联邦越权执法提供法律依据。同日,纽森还签署了其他多项法案,要求执法人员执勤时显示姓名或警徽、学校须在移民执法行动时通知家长,并禁止学校和医疗机构在无有效令状情况下允许ICE人员进入。

33. Zig got a new ELF linker and it's fast (github.com)

Moved to Codeberg. Contribute to ziglang/zig development by creating an account on GitHub.

34. LinkedIn will soon train AI models with data from European users (hostvix.com)

LinkedIn计划使用欧洲用户的个人数据来训练其AI模型。此举基于欧洲数据保护委员会的决定,即在用户同意的前提下,将个人数据用于合法商业利益,如AI模型开发。

用户将获得选择退出该数据使用的权利,具体可通过LinkedIn账户设置中的数据隐私选项进行关闭。

该公司同时透露,也有计划利用来自世界其他地区的用户数据来训练模型,这些计划预计将在2024年内逐步展开。

该决定已引发部分用户和隐私倡导组织的反对与担忧。

35. A simple way to measure knots has come unraveled (www.quantamagazine.org)

Two mathematicians have proved that a straightforward question — how hard is it to untie a knot? — has a complicated answer.

36. SGI demos from long ago in the browser via WASM (github.com)

Collect every Silicon Graphics (SGI) demo ever made and resurrect them in the browser to live on forever. - sgi-demos

38. Be careful with Go struct embedding (mattjhall.co.uk)

Go语言中的结构体嵌入是一种组合类型的机制,允许将一个结构体嵌入到另一个中,从而直接访问嵌入字段的成员。例如,通过嵌入PositionColour结构体到Rectangle中,可以直接使用r.Xr.Y访问坐标字段,简化代码。

然而,当多个嵌入结构体包含同名字段时,可能出现意外行为。在示例中,Options结构体嵌入了FooServiceBarService,两者均定义了URL字段。初始化Options后,访问opts.URL预期会因字段模糊性导致编译错误,但实际上打印出abc.com。这是因为Go编译器优先选择最不嵌套的版本,即直接嵌入的FooService中的URL字段,而非更深层的BarService中的字段。

这一行为可能导致运行时逻辑错误,尤其是在大型代码库中。实际工作中曾发生此问题,但通过测试及时发现。开发者在使用结构体嵌入时应谨慎,确保字段名称无冲突,或使用显式访问(如opts.FooService.URL)来避免歧义,从而保持代码清晰和可维护。

39. A board member's perspective of the RubyGems controversy (apiguy.substack.com)

What a week it's been as a Ruby Central Board Member.

40. Timesketch: Collaborative forensic timeline analysis (github.com)

Collaborative forensic timeline analysis. Contribute to google/timesketch development by creating an account on GitHub.

41. The link between trauma, drug use, and our search to feel better (lithub.com)

As long as humans have experienced emotional crisis (which is to say: for all of human history), they’ve attempted to ease their pain with drugs—plant-based psychoactives like marijuana in preindus…