更小的互联网更好吗?
我进行了一个思想实验。完整的实验内容在底部。核心内容如下:
如何构建一个不托管代码的网站,而只是提供如何找到代码的指令。
如果你是一个经验丰富的开发者,答案显而易见:这完全是指令的问题。这就是我们为什么有 JavaScript、Go 和 Rust 的原因。
信息传输极其重要。
你手机上的应用程序,比如 Facebook,允许公司通过用户手机上的 UI 组件和逻辑来提供整个网站,而用户生成内容(文本和图像)则从 Facebook 服务器提供,这大大减少了他们需要通过服务器发送的信息量。这对他们来说是一项巨大的成本削减措施,因为他们需要向每天数十亿的用户提供更小的服务器响应,而这些用户每秒都在访问新内容。
“无服务器”部署的概念是,你托管和提供内容及指令,而用户手机上的应用程序负责所有逻辑,这本质上就是联邦宇宙(fediverse)的理念。
商业上常常有推动力让事情变得更大更酷,然后在速度减缓时又想让它们变得更快。
但在我看来,变革性的“魔法”概念就是让事物对基础设施的依赖性降低。有时候,我想和我的朋友面对面交流。
我真的很想知道这个领域发生了什么,以及人们对此的看法。
思想实验
构建一个编译器,它接受一行指令,告诉客户端如何在网络上搜索片段以编译 DOM。
以下是一些问题:
问题 1:指令
这本质上是一个压缩问题。每条通往高效计算的路径都可能在这里结束。编写一段代码的最有效方法是什么?然后,存储它的最有效方法是什么?一字节的代码能否变成 1000 种不同的算法?从数学上讲,我对此持怀疑态度。一个短整型占 2 字节,因此在每位上得到低于 1 个“指令集”是很困难的。
问题 2:搜索
你如何知道在哪里查找,以便获得快速的代码?
问题 3:唯一性
在一个几乎无限的互联网中,你如何知道某样东西是否是唯一的?
问题 4:搜索
好吧,你有了你的超级压缩算法,可以将一串蓝天的十六进制代码转换为可供解释器使用的有效搜索指令,然后可以找到并扩展成一个更大的网站。
你如何找到它?如果你没有受到搜索引擎的速率限制,无法频繁查询他们的网站以获取小块代码,你必须进行大量昂贵且耗时的搜索。
Ping 服务器,访问地址,搜索 DOM。返回成功或失败。继续进行。
你可以通过拥有某种博尔赫斯的无限图书馆来“修复”这个问题,以便进行搜索。
实际用例:
将指令放在二维码上,用手机扫描,加载一个不托管在服务器上的网站,而是通过代码直接传输到你的手机上。??? 盈利。
结果:
有更好的方法来实现上述用例。将一个网站压缩成几页二维码,制作一个可以横扫它们并加载的网站的视频。
信息传输和存储。
如果你过于追求效率,你会自食其果,因为效率是借用其他系统的。
美国交通部进行维修以进行升级。标准的推出速度与事物的损坏速度相当。事物总是在损坏,因此总是在升级。
这说明了传播新变化的困难。
信息和传输并不是免费的。从哲学上讲是的,但从物质上讲,这很昂贵。
你必须深入开发,不仅是语言,还有整个信息的存储、传输和分发系统。就像任何“全球完美”的系统一样,它是一个不同参与者的网络,各自有不同的目的,为彼此设计不同的标准。
所以我们回到了起点,带着一点额外的清晰度。
查看原文
I did a thought experiment. The full experiment is at bottom. Here’s the core:<p>How can you build a website that doesn't host code, just instructions on how to find it.<p>If you're a seasoned dev, the answer is obvious, it's instructions all the way down. That is why we have JS, go, rust.<p>Information transmission is extremely important.<p>Apps on your phone, like Facebook, allow the company to serve the entire website with the UI kit and logic on your phone, and the UGC (text and images) served from FB, drastically cutting down the amount of info they have to send over the server. It's a huge cost cutting manoeuvre for them to serve smaller server responses to billions of daily users who are accessing new content every second.<p>“Serverless” deployment where you host and serve content and instructions, and the app on the users phone is what does all the logic is essentially the idea behind the fediverse.<p>There's often a push from business to make things bigger and cooler, and then when they slow things down, to make them faster.<p>But IMO the transformative "magic" concept is just making things less reliant on infrastructure. Sometimes I want to talk to my friends in person.<p>I’m really curious to know what is going on in this sector and what people think about it.<p>THOUGHT EXPERIMENT<p>Build a compiler that takes a line of instructions that tells the client how to search through the web for snippets to compile the DOM.<p>Here are some issues<p>Problem 1: Instructions
It's essentially a compression problem. Every pathway to efficient compute can end up here. What is the most efficient way to write a piece of code. Then what is the most efficient way to store it. Can a single byte of code spring into 1000 different algorithms. Mathematically, I'm skeptical. A short int is 2 bytes, so getting below 1 "instruction set" per bit is tough.<p>Problem 2: Searching
How do you know where to look in a way that results in fast code<p>Problem 3: Uniqueness
How do you know, in a practically infinite internet, whether something is unique or not?<p>Problem 4: Searching
Okay so you have your super compression Algo that can take a Blue sky string of hexcode and spit out a viable set of search instructions to an interpreter, that can then be found and expand into an even larger website.<p>How do you find it? If you aren’t rate-limited by search engines for hammering their sites for little pieces of code, you have to do a bunch of expensive, time intensive search.<p>Ping the server, go to the address, search the dom. Return pass or fail. Keep going.<p>You can "fix" for this by having some sort of Borges infinite library that you can search through.<p>Real use case:
Stick instructions on a QR code, scan with your phone, load a website that is not hosted on a server, but instead fed directly to your phone by the code. ??? Profit<p>Result:
There are better ways to achieve the above use case. Compress a website into a few pages of QR codes, make a video that can wipe across them and load it.<p>Information transmission and storage.<p>If you lean too heavily into efficiency, you shoot yourself in the foot because efficiency borrows from other systems.<p>The USDOT does repair to upgrade. Standards are rolled out as fast as things break. Things are constantly breaking, so things are constantly getting upgraded.<p>This speaks to the difficulty to which propagating new changes is really hard.<p>Information and transmission aren't free. Philosophically yes, but materially, it’s expensive.<p>You have to get into the nitty gritty of developing not just languages, but entire storage, transport, distribution systems of information. Like any "globally perfect" system, it's a network of different players all at cross purposes, designing different standards for each other.<p>So here we are, back where we started, with an extra iota of clarity.