[译]What is the Web's Model of Computation?

What is the Web's Model of Computation?

Luca Cardelli

Digital Equipment Corporation, Systems Research Center

[email protected]

来源:http://www.cs.vu.nl/~eliens/WWW5/papers/[email protected]

缘起

在用google探索CGI时,在w3c网站上看到,觉得不错,就翻译了一下。这篇关于web计算模型的文章写于1996年,距离互联网元年(1995,网景公司上市)仅仅一年。

本文主要的论点是:web计算模型是一种全新的模型,不同于传统模型。虽然,现在已经是2014年了,但是关于web计算模型的问题依然值得思考,web计算模型是什么?眼下的大数据和云计算和这个计算模型有何关系?web的未来如何Web核心技术(HTMLHTTPURI)背后的架构风格REST(表述状态转换)如何体现web计算模型?

正文

The communication protocols that bind the Internet together synthesize a global computer out of a large collection of processors and networks. A natural question is: how do we program this global computer and, in particular, how do we program the World-Wide Web? If we could integrate the Web with a proper distributed object system like CORBA, all our programming problems would be solved. Or would they?

将互联网结绑定的通信协议合成一个拥有大量处理器和网络的全球性的电脑。一个自然的问题是:我们如何对这个全球计算机编程,特别是,我们如何对万维网编程?如果能将webCORBA这样的分布式对象系统进行集成,那么所有的编程问题将得到解决,是这样吗?

 

Every program is based on an underlying model of computation. Traditionally, we have used sequential, functional, relational, concurrent, and distributed models. In order to program the Web, we first need to understand the Web's model of computation: does it correspond to a traditional model, or is it something new? Once we agree on a model (or, maybe, more than one), we can create APIs that embody that model, and eventually extend or design programming languages for that model.

每个程序都是基于潜在的计算模型。传统上,使用顺序,功能,关系,并行和分布式模型。为了在web上编程,首先需要了解Web的计算模型:它对应于传统模式,或者是新计算模式?一旦得到一个模型(或者不止一个),就可以创建一个包含该模型的API,并为该扩展扩展一个现有编程语言或设计新的编程语言。


Traditional models of data and computation have been successfully imposed onto the Internet. For example, Telnet reduces the Internet to a multiprocessor, while FTP reduces it to a file system. Currently, the trends are to reduce the Internet to a distributed object system, to a distributed agent system, or to a combination of both (as in my own work with Obliq). Noticeably, all these models are based on a reasonable degree of reliability of the underlying computing infrastructure.

传统模型的数据和计算已经成功地应用到互联网。例如,telnet将互联网简化为多个处理器,而FTP将互联网简化为一个文件系统。目前,趋势将因特网简化为分布式对象系统,分布式主体(agent系统,或两者的组合。值得注意的是,所有这些模型都是基于底层合理可靠的计算基础设施。

 

The Web (i.e., http) can be seen to embody a significantly different model of computation, and perhaps we should not try to force this model into a traditional one. A common experience exemplifies this point. When browsing, we actively observe the reliability and bandwidth of certain connections (including zero or varying bandwidth), and we often take action on these dynamic quality-of-service observations. These observables are not part of traditional models of computation.

Web(即HTTP)可以看做一个显著不同的计算模式,也许不应该试图试图将其看作一个传统模型。一个共同的经验充分体现了这一点。当浏览网页时,会积极观察某些的连接的可靠性和带宽(包括零或变化的带宽),并且根据对那些动态质量的服务的观察相应的行动。这些观测不是传统计算模式的一部分。

 

As a general principle, we want to be able to program any algorithm that can be enacted by a person. Hence, a Web program must be able to react to variable quality of service and to a lack of referential integrity. Furthermore, a Web programming language must be able to express quality-of-service abstractions, so as to increase reliability. We need to base such a language on a model of computation that is more refined than (reliable) distributed objects and agents.

通俗的来说,希望能够编写和每个人交互的任何算法。因此,Web程序必须能够应对服务质量的参差不齐,以及参照完整性的缺乏。此外,Web编程语言必须能够表达服务质量的抽象,从而提高可靠性。我们必须立足于这样的语言,其中的计算模型比(可靠的)分布式对象和代理商更精致。

 

It will certainly be possible to isolate reliable subsets of the Web (e.g. intranets, agent servers, replicated databases), and use traditional models of computation for those. But it seems unlikely that the whole Web will ever be entirely reliable, since everybody's home PC may eventually become a Web server.

它肯定会尽可能隔离一些web的可靠子集网络(如企业内部网,代理服务器,备份数据库),并也要隔离那些使用传统计算的模型网络。整个网络永远是完全可靠的是不可能的,因为每个人的PC机都可能成为一个Web服务器。


Therefore, while it is certainly easier to program a distributed object system than the Web, we cannot just hope to turn the latter into the former. We must describe and deal with the peculiar properties of the Web itself.

因此,对分布式对象系统进行编程肯定比对web进行编程更容易,但不能期望后者成为前者,必须描述和处理web本身的特殊属性。

备注

除了这篇文章,我还发现一个有趣的东西Libwww这里翻译一下简介:

Libwww is a highly modular, general-purpose client side Web API written in C for Unix and Windows (Win32). It's well suited for both small and large applications, like browser/editors, robots, batch tools, etc. Pluggable modules provided with libwww include complete HTTP/1.1 (with caching, pipelining, PUT, POST, Digest Authentication, deflate, etc), MySQL logging, FTP, HTML/4, XML (expat), RDF (SiRPAC), WebDAV, and much more. The purpose of libwww is to serve as a testbed for protocol experiments. 

Libwww是一个高度模块化,通用目的的用C编写的客户端web API(适用UnixWindows)。它适用范围广(大小通吃),比如浏览器/编辑器,机器人程序,批处理工具等。Libwww插件模块包括HTTP/1.1(缓存,管道,PUTPOSTDigest权限,deflate-一种无损数据压缩算法 等)Mysql登录,FTPHTML/4
XMLRDFWebDAV以及其他。Libwww的目的是用作测试协议实验。

这里,可以看到,无论什么web服务器都必须包含一个类似libwww这样的库。

后记

经过了这么多年的发展,我想Web应该找到了吧。最近流行反璞归真,重新认识HTTP及其背后的架构风格REST,流行RESTful APIs。看了一些资料,只明白了RailsCRUD映射为HTTP动作的(POSTGETPUTDELETE),知道REST中的一些约束:客户-服务器、无状态、缓存、统一接口、分层系统、按需代码,具体如何,不甚了解。

关于REST相关的书,《Rails高级编程》中第7章有介绍,《REST实战 中文版》也很不错,《RESTful web service》只闻其名,未见其人,还有就是Roy Fielding 的博士论文《Architectural Styles and the Design of Network-based Software Architectures》,中文名翻译为《架构风格与基于网络的软件架构设计》。

参考资料

1.What is the Web's Model of Computation?

2.Libwww:http://www.w3.org/Library/

你可能感兴趣的:(翻译,web,REST,REST,Libwww,web计算模型,http)