0%

今日 Hacker News 热榜同时出现「可视化教学与复古平台」和「隐私、形式化验证与系统软件」两条主线:从 PGSimCity、Decker、htmx Game Boy 周边,到 GrapheneOS 机场搜查案与 Lean 证明自动化。另有野火气象、TypeScript 原生编译与硬件 DIY 时钟等话题。以下按当前热度前十整理,背景与讨论均依据公开页面与 HN 评论,未核实到的细节已标明。

1. PGSimCity - How PostgreSQL Works

背景介绍
PGSimCity 是一个可在浏览器中探索的 3D「城市」模型,用 WebGL2 把 PostgreSQL 引擎内部结构可视化。站点自称早期、未充分审阅的原型,并提醒模型与解说可能存在不准确之处,欢迎提 issue / PR。

主要讨论方向与观点
评论普遍欣赏「用空间隐喻讲数据库内核」的方向,同时批评自动导览信息过密、节奏过快,希望能放慢、可交互,并最好能输入真实查询后沿解析→执行路径走一遍。也有熟悉 Postgres 的读者表示画面过忙反而更难理解;另有人提醒 “SimCity” 仍是 EA 商标,建议改名。

专有名词解释

  • PostgreSQL:开源关系型数据库,常简称 Postgres。
  • WebGL2:浏览器中的 3D 图形 API,本项目依赖其渲染「城市」。

HN 讨论thread · 393 分 · 41 评

2. Show HN: Physically accurate black hole you can put in your room

背景介绍
作者 Alexander Plavin(哈佛 Black Hole Initiative)发布浏览器端黑洞可视化,可用屏幕或 WebXR(AR/VR)把黑洞「放进房间」。项目页面注明为简化可视化,科学级渲染另指向 Synchray.jl。Show HN 正文强调基于职业射线追踪 / 辐射转移经验做成可玩版本。

主要讨论方向与观点
多数反馈是视觉冲击与趣味性;严肃评论则质疑「physically accurate」表述,指出吸积盘亮度各向异性、Kerr/Schwarzschild 等简化可能造成误导性科普。也有人讨论与 Event Horizon Telescope 公开成像的相似处,并开玩笑式互动(房间里已有黑洞、猫失踪等)。

专有名词解释

  • 吸积盘(accretion disk):绕黑洞旋转的物质盘,是常见可视化中的亮环来源。
  • WebXR:浏览器扩展现实 API,用于 AR/VR 场景。

HN 讨论thread · 204 分 · 58 评

3. Decker, a platform that builds on the legacy of Hypercard and classic macOS

背景介绍
Decker 是面向交互文档的多媒体创作平台:支持图像、声音、超文本与脚本,美学延续经典 Mac / 1-bit 「ditherpunk」。成品可导出为可在浏览器自执行的 HTML;亦有原生客户端。脚本语言为 Lil。该话题在 HN 上多次出现过。

主要讨论方向与观点
怀旧派怀念 HyperCard「非程序员也能搭应用」的体验;实用派争论此类自包含小应用在 2026 是否仍有真实场景(对照 FileMaker / Access / LiveCode)。有人喜欢创意约束,也有人觉得复古 UI 妨碍日常用途,希望更「现代白板」取向。

专有名词解释

  • HyperCard:Apple 经典卡片式创作环境,影响了后来许多低代码工具。
  • Lil:Decker 内置脚本语言,用于卡片行为与逻辑。

HN 讨论thread · 279 分 · 72 评

4. Scriptc by Vercel: TypeScript-to-Native compiler, no JavaScript engine in binary

背景介绍
据 vercel-labs/scriptc 的 README:scriptc 把普通 TypeScript 编译为小型原生可执行文件,静态路径下二进制内不嵌入 Node/V8;另有 --dynamic 模式可用嵌入的 quickjs-ng 处理无法静态编译的部分。示例称 fib 二进制约 178KB、启动约 2ms;主要平台为 macOS arm64。

主要讨论方向与观点
讨论集中在:与 Porffor、AssemblyScript、其他「TS→native」实验的对比;npm 生态大量是无类型 JS,完整兼容是否仍需 JS 引擎;以及 README 风格与「Vercel Labs 短命 demo」的质疑。也有人对二进制体积与真实用例(是否替代 Electron 等)表示困惑。

专有名词解释

  • TypeScript-to-Native:把 TS 直接编成机器码,而不是先落到 JS 再由运行时执行。
  • Test262:ECMAScript 一致性测试套件,常被用来衡量 JS 实现完整度。

HN 讨论thread · 101 分 · 40 评

5. French firefighters face ‘pyrocumulonimbus’ for first time

背景介绍
France24 报道法国消防人员面对由野火驱动的对流云(标题称 pyrocumulonimbus)。抓取原文时该站返回 HTTP 403,以下主要依据 HN 标题与评论中的可核实表述:讨论涉及 Landes/Médoc 等地松林易燃背景,以及波尔多周边大规模疏散等现场描述(评论者自称亲历,未经本摘要独立核实)。

主要讨论方向与观点
有人引用 Le Monde 等报道,称「首次」表述需谨慎,强调该现象规模异常但仍可能并非绝对第一次。气象爱好者争论应称 pyrocumulus 还是 pyrocumulonimbus(nimbus 暗示降雨)。另有澳大利亚、美国华盛顿州读者分享本地类似「火积云」经验及其对灭火装备的危险。

专有名词解释

  • Pyrocumulonimbus / pyrocumulus:由大火加热空气上升形成的对流云;强时可影响局地天气与火势蔓延。
  • Landes:法国西南松林地区,历史上大规模人工造林,易燃性强。

HN 讨论thread · 281 分 · 167 评

背景介绍
TechSpot(2026-07-26)报道:亚特兰大居民 Sam Tunick 在哈茨菲尔德-杰克逊机场二次检查中被要求解锁手机;其 GrapheneOS 设备在输入口令后出现重启/擦除迹象。检方试图以销毁财产妨碍扣押相关联邦法条起诉;辩护方主张搜查违宪、证据应排除。报道称调查背景涉及其与反对 Cop City 运动的关联指控。

主要讨论方向与观点
核心争点:duress PIN(胁迫口令)主动擦除是否构成「销毁证据」;边境搜查权力边界;以及引用的 18 U.S.C. §2232 是否适用于「搜查」而非「扣押」。建议包括:过境前自行擦除并异地恢复、使用诱饵卷/诱饵系统,以及认为起诉动机政治化等。也有人澄清标题易误解——并非随机失败擦除,而是用户提供了可触发擦除的口令。

专有名词解释

  • GrapheneOS:面向 Google Pixel 的注重隐私与安全的开源 Android 发行版。
  • Duress PIN:额外口令;输入后会不可逆擦除设备数据(及关联设备,视配置而定)。

HN 讨论thread · 510 分 · 353 评

7. We have proof automation now

背景介绍
Adam Langley(ImperialViolet)撰文讨论依赖类型语言(Rocq/Coq、Lean)长期受「证明成本」拖累(引用 seL4 等经验中证明工作量远高于实现),并认为 LLM 结合证明无关性等机制可能显著降低证明自动化门槛。文章同时落到与 Zstandard 等相关的具体形式化实践(评论亦指出文中有大量 zstd 内容)。

主要讨论方向与观点
支持者看好「写形式化规约 + LLM 填证明」成为未来编程核心技能,并提到 Verus、已有的加密例程验证部署等。怀疑者提醒 Curry–Howard:证明与程序对偶,规约写错仍会产出「正确证明的错误规格」;另有人讨论形式化项目质量参差与成本结构变化(漏洞挖掘变便宜 vs 验证变便宜)。

专有名词解释

  • Lean / Rocq (Coq):可做定理证明与依赖类型编程的交互式定理证明器。
  • 形式化验证:用数学证明保证程序满足规约,而非仅靠测试抽样。

HN 讨论thread · 137 分 · 31 评

8. I wanted a clock that never needed setting. Things escalated

背景介绍
Ars Technica 特稿:作者想做一台几乎不用手动对时的钟,结果方案升级到 Raspberry Pi、Adafruit 七段数码管、3D 打印外壳,并接入远程更新、网络与智能家居等能力(摘要页描述含 vibe coding)。

主要讨论方向与观点
大量「时间极客」共鸣,同时吐槽过度工程:对比几十年无需联网的市电同步钟、NIST 无线电原子钟、ESP32+NTP+RTC 等更简单方案。争论焦点是「永不对时」的真实需求 vs IoT 化带来的维护成本(发行版升级、电池、信号覆盖)。

专有名词解释

  • NTP:网络时间协议,用于从时间服务器同步时钟。
  • Atomic clock(消费电子语境):常指接收国家标准电台授时信号自动校时的民用钟,并非家用铯原子振荡器。

HN 讨论thread · 75 分 · 74 评

9. Htmx 4.0, the first JavaScript library to release exclusively on the Game Boy

背景介绍
htmx 周边商店上架「htmx 4: the game」——宣传为「第一个只在 Game Boy 平台发布的 JavaScript 库」,实体卡带小品;页面描述含收集 pickle、压缩前端 JS、解锁源码等关卡梗。这是技术社区常见的自嘲式发布/周边营销,而非传统 npm 发版公告。

主要讨论方向与观点
评论多称赞 htmx 团队的工艺感与幽默感;有人现场回忆开发者大会发放实体卡带。技术向讨论回到 htmx 本身:与旧式 UpdatePanel 的相似性、noscript 降级不足、以及用 htmx+Go+Postgres 替换重型栈的实践经验。

专有名词解释

  • htmx:通过 HTML 属性驱动 AJAX/交换局部 DOM 的前端库,强调超媒体风格。
  • Game Boy:任天堂掌机平台;此处为实体卡带周边/小品发布载体。

HN 讨论thread · 407 分 · 140 评

10. Introduction to Data-Oriented Design [pdf]

背景介绍
链接为 Mike Acton 关于 Data-Oriented Design(DOD)的经典演讲 PDF(托管于 gamedevs.org)。核心主张是围绕数据布局与变换来设计程序,以更好利用缓存与吞吐,常见于游戏与高性能场景。PDF 二进制抓取无法直接提取正文,内容概述主要依据演讲主题与 HN 讨论(未逐页核验 PDF 全文)。

主要讨论方向与观点
讨论者强调「先定义数据形状再写算法」;有人分享 Acton 相关的 LLM skill 资源。批评/补充观点包括:需求多变时 DOD 灵活性不足;DOD 是否实质等于面向缓存的数组化/并行处理;以及社区有时过于教条、忽视适用边界。

专有名词解释

  • Data-Oriented Design (DOD):以数据布局与变换效率为中心的设计方法,常对比面向对象按「对象」组织代码。
  • Cache-aware:刻意让数据结构适应 CPU 缓存行,减少内存延迟。

HN 讨论thread · 150 分 · 40 评

In React Native, logical AND may cause crash as below.

Conditional rendering in React Native may crash your app

This babel plugin here can replace all logical AND with ternary operators, with a little more configuration.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// .babelrc.js
module.exports = function (api) {
api.cache(true);

const presets = [];
const plugins = [
'./ternary-jsx.js',
// this two plugins below only parse but not transform code
['@babel/plugin-syntax-decorators', { decoratorsBeforeExport: true }],
['@babel/plugin-syntax-class-properties', { loose: true }],
];

return {
parserOpts: {
plugins: ['jsx', 'typescript'],
},
presets,
plugins,
generatorOpts: {
retainLines: true,
compact: false,
minified: false,
concise: false,
},
};
};

However, Babel will lose some code formatting in the process, as it works based on the AST..

引言

开发过程中经常会碰到相同的逻辑,一般为了代码的整洁性,都会进行复用。
但是是不是所有相同的逻辑都需要复用呢?

实际场景

有两个商品卡片需要实现,其中一个是热点商品,一个是普通商品
两个在长相上有一些区别,大概在30%左右
热点商品多了标签,背景色,按钮等功能

  • 复用型写法I
1
2
3
4
5
6
7
8
9
10
11
12
function ProductCard({isHot, price, productImage, productUrl}) {

return (
<div style={isHot ? styles.cardWithBg : {}}>
{isHot && <Tag />}
<span>{price}</span>
{isHot && <Button />}
<img src={productImage} onClick={() => Navigate.push(productUrl)} />
</div>
)

}
  • 复用型写法Ⅱ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function CommonProductCard({price, productImage, productUrl}) {
return (
<div>
<Price price={price} />
<ProductImage image={productImage} url={productUrl} />
</div>
)
}

function HotProductCard({price, productImage, productUrl}) {
return (
<div style={styles.cardWithBg}>
<Tag />
<Price price={price} />
<Button />
<ProductImage image={productImage} url={productUrl} />
</div>
)
}

function Price({price}) {
return <span>{price}</span>
}

function ProductImage({image, url}) {
return <img src={productImage} onClick={() => Navigate.push(productUrl)} />
}

复用型I的代码说不上来的别扭,绝对的垃圾代码
复用型Ⅱ是经常能见到的,看起来解耦非常不错,也容易理解,但是细想:
热点商品为什么要跟普通商品的UI复用?两者本来就应该长得不一样。现在只是恰巧有某些地方是一样的,后来我说不定就改了。

技术层面复用逻辑没有问题,但是回到需求本身,这种复用是没有必要的,本来这两个东西就应该是分开的。
所以不如复制粘贴再写一遍更好:

  • 分离型写法
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function CommonProductCard({price, productImage, productUrl}) {
return (
<div>
<span>{price}</span>
<img src={productImage} onClick={() => Navigate.push(productUrl)} />
</div>
)
}

function HotProductCard({price, productImage, productUrl}) {
return (
<div style={styles.cardWithBg}>
<Tag />
<span>{price}</span>
<Button />
<img src={productImage} onClick={() => Navigate.push(productUrl)} />
</div>
)
}

总结

不要盲目的复用代码,即使他们在逻辑上有相同之处,也要看这种逻辑相同是否是需求所期望的,可能只是偶发性的相同。

How to add Category and Tag page

If you want one page list all categories, just create source/categories/index.md, and then write type: categories in it, which tells Hexo to create public/categories/index.html. “Tags”, “About” are the same.

1
2
3
4
cd source
mkdir categories
cd categories
vi index.md
1
2
3
4
5
6
<!-- index.md -->
---
title: categories
type: "categories"
---

Backgrounds

1
2
parseInt(0.0000005)
// 5

Explanations

parseInt accepts string as the first argument, represents the value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation.

​ In JavaScript, the number which has more than 6 zeros in front of the first non-zero digit will be displayed in scientific notation, specified by ECMA . That means , 0.00000005.toString() will return '5e-7'

​ So, the code above can be explained as following:

1
2
3
4
5
6
7
0.0000005.toString()
// '5e-7'

parseInt(5e-7)
// 5
parseInt('5e-7')
// 5

Extra

What about postive numbers ?

1
2
3
4
5
6
7
8
9
10
11
parseInt(5e7)
parseInt(50000000)
// both return 50000000

// 5e7 will not be displayed in scientific notation
5e7.toString()
// '50000000'

// '5e6' is string
parseInt('5e6')
// 5

Tips

parseInt should not be used as a substitute for Math.floor()

Traditional currency system

  1. Role of Central Banks: Central banks issue fiat currency and use tools like interest rate policies to regulate the economy.
  2. Regulation and Compliance: Financial institutions are supervised by government and regulatory bodies to ensure stability and transparency in the financial system.
  3. Credit System: The modern monetary system relies on a credit system, where individuals and businesses obtain loans and credit through banks.

It is clear that the traditional monetary system is centered around governments and central banks.

What is de-centralized

Imagine a system, where everyone can earn currency through a certain amount of labor and freely engage in transactions. In the absence of a central organization, individuals cannot deceive others to obtain currency or fabricate transactions, just like being compelled to adhere to the laws of physics.

How to solve trust problem?

PoW(Proof of Work).

How to drive miner running the server?

Bonus.

How to run one app on the blockchain?

DApp. Introduce ETH.

How to speed up the transaction?

DPoS.

How to exchange with other coins?

WBTC.

what is the cryptocurrency exchanges?