用 Zig 重写终端 reset,1ms 替代 1s
If your terminal ever gets into a 'bad state', like garbled outputs, you run 𝚛𝚎𝚜…
If your terminal ever gets into a 'bad state', like garbled outputs, you run 𝚛𝚎𝚜𝚎𝚝. I noticed it was… oddly slow.
如果你的终端进入“坏状态”,比如输出乱码,你会运行 𝚛𝚎𝚜𝚎𝚝。我注意到它……异常地慢。
Turns out in 1979 3BSD's 𝚝𝚜𝚎𝚝 had a 𝚜𝚕𝚎𝚎𝚙(𝟷) to let mechanical printer-and-ink terminals 'settle down' 😂
原来在1979年的3BSD中,𝚝𝚜𝚎𝚝 有一个 𝚜𝚕𝚎𝚎𝚙(𝟷) 命令,是为了让机械打印机和墨水终端“稳定下来” 😂
I asked 𝚏𝚡 to write me a faster alternative in Zig. It takes 1ms instead of 1s. It was really cool to dive deeper into 𝚗𝚌𝚞𝚛𝚜𝚎𝚜, 𝚝𝚜𝚎𝚝, 𝚝𝚎𝚛𝚖𝚒𝚗𝚏𝚘, and the myriad ways in which your terminal can get… cursed.
我让 𝚏𝚡 用 Zig 写了一个更快的替代方案。它只需1毫秒而不是1秒。深入探索 𝚗𝚌𝚞𝚛𝚜𝚎𝚜、𝚝𝚜𝚎𝚝、𝚝𝚎𝚛𝚖𝚒𝚗𝚏𝚘 以及你的终端可能变得“被诅咒”的种种方式,真的非常酷。
It's legit fascinating how far back our technology stack goes, and how enduring good system design is, even with the occasional 'spider webs' you can find.
我们的技术栈能追溯到那么久远,而且良好的系统设计如此持久,这确实令人着迷,即使偶尔能找到一些“蜘蛛网”般的遗留问题。
Check out http://github.com/rauchg/rst for a fun explainer (and some alternative solutions.)
查看 http://github.com/rauchg/rst 获取有趣的解释(以及一些替代解决方案)。
ps: once you start using 𝚏𝚡, you'll notice slowness like this everywhere :D
附注:一旦你开始使用 𝚏𝚡,你会注意到这种慢速现象无处不在 :D
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力