← Joel on Software

Progress on the Block Protocol

区块协议的进展
Mon, 19 Dec 2022 13:01:40 +0000  ·  Joel on Software  ·  原文

Since the 1990s, the web has been a publishing place for human-readable documents.

自 20 世纪 90 年代以来,网络一直是人类可读文档的发布场所。

Documents published on the web are in HTML.

在网络上发布的文档采用 HTML 格式。

HTML has a little bit of structure, for example, “here is a paragraph” or “emphasize this word.”

HTML 有一点结构,例如,“这是一个段落”或“强调这个词”。

Then you stir in some CSS, which adds some pretty decorations to the structure, saying things like: make those paragraphs have tiny gray sans-serif text!

然后你加入一些CSS,它为结构添加了一些漂亮的装饰,比如:让这些段落有微小的灰色无衬线文本!

And then people think you are hip.

然后人们就会认为你很时髦。

Unless they are older, and they can’t read your tiny gray words, so they give up on you.

除非他们年纪大了,看不懂你的灰色小字,所以他们就会放弃你。

Goodnight Moon by Margaret Wise Brown Illustrated by Clement Hurd Harper & Brothers, 1947 ISBN 0-06-443017-0

玛格丽特·怀斯·布朗的《晚安月亮》,克莱门特·赫德哈珀兄弟出版社插图,1947 年 ISBN 0-06-443017-0

There’s not much structure there.

那里没有太多结构。

A naive computer program reading this web page might not realize I was even mentioning a book.

阅读此网页的天真的计算机程序可能没有意识到我什至提到了一本书。

All I did was make the title bold.

我所做的只是将标题加粗。

So, also since the 1990s, people have realized that we can make the web a much more useful place to publish information if we applied a bit more structure.

因此,自 20 世纪 90 年代以来,人们已经意识到,如果我们应用更多的结构,我们可以使网络成为更有用的信息发布场所。

As early as 1999, Tim Berners-Lee was writing about the Semantic Web :

早在 1999 年,Tim Berners-Lee 就撰写了有关语义网的文章:

“I have a dream for the Web [in which computers] become capable of analyzing all the data on the Web – the content, links, and transactions between people and computers.

“我对网络有一个梦想,让计算机能够分析网络上的所有数据——内容、链接以及人与计算机之间的交易。

A ‘Semantic Web’, which makes this possible, has yet to emerge, but when it does, the day-to-day mechanisms of trade, bureaucracy and our daily lives will be handled by machines talking to machines.

使这成为可能的“语义网”尚未出现,但当它出现时,日常贸易机制、官僚机构和我们的日常生活将由机器与机器对话来处理。

The ‘intelligent agents’ people have touted for ages will finally materialize.”

人们多年来吹捧的‘智能代理’最终将成为现实。”

Using the Semantic Web you might publish a book title with a lot more detail that makes it computer-readable.

使用语义网,您可以发布包含更多详细信息的书名,使其具有计算机可读性。

To do this, you would probably start by going to schema.org and looking up their idea of a book .

为此,您可能首先要访问 schema.org 并查找他们的一本书的想法。

Then you could use one of a number of formats, like RDF or JSON-LD, to add additional markup to your HTML saying “hey!

然后,您可以使用多种格式之一(例如 RDF 或 JSON-LD)向 HTML 添加额外的标记,表示“嘿!

here’s a book!”

这是一本书!”

Ok, well, doing that is kinda hard to figure out, and, to be honest, it’s homework.

好吧,这样做有点难以弄清楚,而且说实话,这是家庭作业。

Once your beautiful blog post is published and human-readable, it’s hard to gather the mental energy to figure out how to add the additional fancy markups that will make your web page computer-readable, and, unless there is already a computer reading your web pages, at this point, you usually give up.

一旦你的漂亮的博客文章发布并且可供人类阅读,就很难集中精力来弄清楚如何添加额外的花哨标记以使你的网页计算机可读,而且,除非已经有计算机在阅读你的网页,否则你通常会放弃。

So, yeah.

所以,是的。

That was 1999, and not much progress has been made and there is very little of this semantic markup in the wild.

那是 1999 年,还没有取得太大进展,而且这种语义标记也很少。

Well.

出色地。

We would like to fix this, because human progress depends on getting more and more information in formats that are readily accessible, both by regular humans, their dumb A.I.

我们希望解决这个问题,因为人类的进步取决于以易于访问的格式获取越来越多的信息,无论是普通人还是他们愚蠢的人工智能。

li’l sibs, and your more traditional computer programs.

li’l sibs,以及更传统的计算机程序。

Here is something I believe: people will only add semantic markup to their web pages if doing so is easier than not.

我相信:人们只会在他们的网页上添加语义标记,如果这样做比不这样做更容易的话。

In other words, the cost of adding semantic markup has to be zero or negative, or this whole project is not going anywhere.

换句话说,添加语义标记的成本必须为零或负数,否则整个项目将不会有任何进展。

Now imagine this world for a second: I want to insert a book into my blog post I type /book A search box appears where I start typing in the title of my book and choose from an autocomplete list.

现在想象一下这个世界:我想在我的博客文章中插入一本书,我输入 /book 出现一个搜索框,我开始在其中输入我的书名并从自动完成列表中进行选择。

Once I find the book, a block gets inserted in my blog post showing details of the book in a format I like, with nice semantic markup behind the scenes .

一旦我找到这本书,我的博客文章中就会插入一个块,以我喜欢的格式显示这本书的详细信息,并在幕后提供漂亮的语义标记。

In this world I did less work to insert a book (because I was assisted by a UI that looked up the details for me).

在这个世界中,我插入一本书的工作量更少(因为我得到了一个为我查找详细信息的用户界面的帮助)。

You can imagine the same scenario applying to literally any other kind of structured data.

您可以想象同样的场景适用于任何其他类型的结构化数据。

My “address block” might have any visual appearance.

我的“地址块”可能有任何视觉外观。

Visitors to my web page might see the address, or a little map, or a little map in Japanese, etc. etc. The semantic content is there behind the scenes.

我的网页的访问者可能会看到地址,或者一个小地图,或者一个日语小地图等等。语义内容就在幕后。

So, for example, my web browser might know “gosh this is an address!

因此,例如,我的网络浏览器可能知道“天哪,这是一个地址!

Maybe you want to do address-y things with it, like go there ,” and then my browser might offer me options to summon a self-driving car and even call an ambulance when the self-driving car self-drives into a snowbank.

也许你想用它做一些有针对性的事情,比如去那里,”然后我的浏览器可能会为我提供召唤自动驾驶汽车的选项,甚至当自动驾驶汽车自动驶入雪堆时呼叫救护车。

My two simplistic examples of “book” and “address” are interesting right now because (a) you can probably think of 1,000,000 more data types like this, and (b) none of these things work right now, because even though almost every web editing environment has a concept of “blocks,” none of them are extensible.

我的两个简单的“书”和“地址”示例现在很有趣,因为(a)您可能会想到另外 1,000,000 种这样的数据类型,以及(b)这些东西现在都不起作用,因为尽管几乎每个 Web 编辑环境都有“块”的概念,但它们都不是可扩展的。

WordPress has (oh gosh) hundreds of block types, but they don’t have thousands or millions, they don’t have “book” or “address” or “Burning Man Theme Camp” yet, and there’s no ecosystem by which developers and users can contribute new block types.

WordPress 有(天哪)数百种块类型,但它们没有数千或数百万,它们还没有“书”或“地址”或“火人节主题营”,并且没有开发人员和用户可以贡献新块类型的生态系统。

So I guess I gotta wait around for someone at WordPress to develop all the blocks I want to use.

所以我想我必须等待 WordPress 的某人开发出我想要使用的所有块。

And then someone at Notion, and then someone at Trello, and then someone at Mailchimp, and someone at every other vendor that provides a text editor.

然后是 Notion 的某个人,然后是 Trello 的某个人,然后是 Mailchimp 的某个人,以及其他提供文本编辑器的供应商的某个人。

The web was built with open protocols.

网络是用开放协议构建的。

Suppose we all agree on a protocol for blocks.

假设我们都同意区块协议。

Then if anyone goes to the trouble of creating a cool “book” or “address” block, we’ll all be able to use it, anywhere.

然后,如果有人不厌其烦地创建一个很酷的“书”或“地址”块,我们都可以在任何地方使用它。

And it should be, I think, 100% free, open, and public, so that there is no impediment to anyone on earth using it.

我认为它应该是 100% 免费、开放和公开的,这样地球上任何人都可以毫无障碍地使用它。

And in fact if you want to make blocks that are open source or public, good for you, but if for some reason you would like to make private or commercial blocks, that’s fine too.

事实上,如果您想创建开源或公共的块,这对您有好处,但如果出于某种原因您想创建私有或商业块,那也很好。

It’s been about a year since we started talking about the Block Protocol, and we’ve made a lot of progress figuring out how it has to work to do all the things it will need to do, in a clean and straightforward way.

自从我们开始讨论区块协议已经大约一年了,我们在弄清楚它如何以一种干净、直接的方式完成所有需要做的事情方面取得了很大进展。

But this is all going nowhere if it requires 93,000,000 humans to cooperate with my crazy scheme just to get it off the ground.

但如果需要 93,000,000 个人配合我的疯狂计划才能实现它,那么这一切都将毫无意义。

So what we did is build a WordPress Plugin that allows you to embed Block Protocol blocks into posts on your WordPress sites just as easily as you insert any other block.

因此,我们所做的是构建一个 WordPress 插件,允许您将块协议块嵌入到 WordPress 网站上的帖子中,就像插入任何其他块一样轻松。

Since WordPress powers 43% of the web, that means if you build a block for the Block Protocol, it’ll be widely usable right away.

由于 WordPress 为 43% 的网络提供支持,这意味着如果您为区块协议构建一个区块,它将立即得到广泛使用。

Here’s a video demo: The WordPress Plugin will be free, and it will be widely available in February, when we’ll also publish version 0.3 of the Block Protocol specification.

这是一个视频演示:WordPress 插件将是免费的,并将于 2 月份广泛使用,届时我们还将发布区块协议规范的 0.3 版本。

You can get early access now.

您现在就可以抢先体验。

In fact, if you were thinking of writing a plugin for WordPress for your own kind of custom block, you’ll find that using our plugin as your starting point is a lot easier, because you don’t have to know anything about WordPress Plugins or write any PHP code.

事实上,如果您正在考虑为您自己的自定义块编写 WordPress 插件,您会发现使用我们的插件作为起点要容易得多,因为您无需了解有关 WordPress 插件的任何信息或编写任何 PHP 代码。

So even if you don’t care for any of my crazy theories and just want to add a block to WordPress, this is the way to go.

因此,即使您不关心我的任何疯狂理论,只是想向 WordPress 添加一个块,这也是正确的选择。

Ultimately, though, we just want to make it easier to add useful semantic, structured information to the web, and this is the first step.

但最终,我们只是想让向网络添加有用的语义、结构化信息变得更容易,这是第一步。

PS We just set up a Discord server for the Block Protocol where you can participate, ask questions, and meet the team.

PS 我们刚刚为区块协议建立了一个 Discord 服务器,您可以在其中参与、提问并与团队会面。

PPS You can follow me on Mastodon, where I am @spolsky@blackrock.city .

PPS 您可以在 Mastodon 上关注我,我的邮箱是 @spolsky@blackrock.city 。

I don’t post that much, but I’m enjoying hanging out there in a human-to-human environment where there isn’t an algorithm stirring up righteous indignation about the latest fake-outrage of the day.

我发的帖子不多,但我很享受在人与人之间的环境中闲逛,那里没有算法激起人们对当今最新的假冒愤怒的义愤。

中文为机器翻译,仅供参考。