LAW: A Language for Agents in the Web ------------------------------------------------------------------------------- Tim Berners-Lee refers to WWW as the DNA of the Internet Well, here is the LAW LAW - Language for Agents in the Web For a long time, people have been talking about active objects, and about agents. Scripting languages have been developed that might enable these type of things to be built, but the run-time system for such languages has been too centralised. Well, now we have 2 pieces of technology that enable us to build agents properly: The WWW and the Mbone (with RSVP and CBQ and CCCP). Names, Objects and Types. LAW is an idea for a language where HTML is a subtype, but URLs are first class data types. A URL is the "address" or "reference" type famliar to assembler or C programmers (note it is NOT, explcitly not a URN - A URN is location independnent - URNs might be provided thru a system written in LAW). [Check out URCs and URAs for further work in this area, that is largely misguided). Finally, a new MIME type is added so that clients know that what is returned from a server is a piece of the LAW. CCCP names are hierarchical names that can include DNS names. The LAW extends these to include URLs, and URLs to include these. We also name other data types, such as media types simply by using MIME types. All other objects, as in Tcl or Telescript, are strings. This is a predefined type merelytfor conbeneince and efficiency (like stdio/iostream). [A Touch of SNOBOL or BLISS!]. {Other languages to look at are LICE (scheme based), Alice, Linda, and other agent work , and JAVA .} [Aside: Java is C++ like. We believe that this is a very misguided design choice. The authors say that "most programmers are used to C++". Sure, but most web users are not programmers.] See also Mobisaic work at Washington for some similarlry neat ideas onm agents and the web. However, LAW does not define non-string operators on these types without the programmer having to go through all the hoops (hops) of a full Abstract Data Typeing activity. Thus it is type safe and type extensible. Scoping of types is yet to be devised, but certainly, containment hierarchies (as in network management) seem like a good approach. Persistence is simply given by writing new WWW pages. A new tag in HTML, HTML Parameter allows laws to be embedded i nthe web. LAW is interpreted, and is readable, but can be incrementally compiled (has an efficient representation, is codified). LAW is functional (==No side effects, ==No side effects). There exists good reference material on functional language implementation and also, in particular, the very fine gofer. LAW programs are stateless, so that they are fault tolerant and can be re-executed harmlessley (idempotency). LAW programs output can be stored in the Web. It remains to be seen whether filters (lazy evaluators of event streams) may wish to store their existence persistently in the Web. Communication Agents of the LAW are run by WWW servers through messages arriving that indicate a script to run through CGI. Initiators and responders for users either receive passive objects (pages) in HTML, or else receive a new MIME type, application/act, which is passed to a User Agent, launched as a "viewer". This can continue communication (i.e. save state) through CCI back to the Wenb client, or might receive Legal Data back in the script, that gives it a communications handle direct back to the server. LAW has communications primiatives similar to unix UDP sockets (or to Tcl or telescript): send() and recv() are basic ways to direct a message to another Agent of the LAW. Multicast is allowed. See the SD spec for how this works! Laws may be passed that are qualified by a class that permits them to be prioritiesed in their application. This has clear uses in networks that provide resource control, in accordance with the scalable approaches (that permit aggregation of resource classes) such as CSZ and CBQ. This will determine how many Laws can be passed by a server or client, or from a server to a client and so forth. It is more important to realize that this is applied to i/o from an agent of the LAW and to the execution of an agent than to the actual passing of LAWs. Who Controls the Agents of the Law? Agents follow control strucutures exactly as in tcl (why give up a good thing). Just as in Tcl, the LAW can be extended. Implementation of the LAW Client and Servers interact with the LAW now through CCI and CGI. Obviously as with other approaches based on WWW, we will eventually construct clients (and servers) entirely within the LAW, as proof of concept, but also for additional security. An interim approach is to add a LAW evaluator with an interface to Tk, as part of a Web client. Applications in Pursuit of the LAW One obvious application of the LAW is the construction of URRs. URRs are Uniform Resource Routes. There are two types of URR. * URRs for exchange of metrics between proxy caching servers and clients: These are used to load balance - i.e. the basic idea that a URN lookup returns a list of URLs is a starting point, but how does a client choose between different URLs for the same URN? Easy - by looking at URRs. * URRs that allow you to track the correct semantic result of a URN lookup: These are much more like agents, that look at user preferences and all kinds of similar stuff. You can see that the first of these is low level, while the second is high level, but that they can conspire together to mutual benefit. Another application is in support of webcasting. Webcasting is the use of the mbone and synchronised clients to allow distance learnign in the same way as wb, but possibly without the data distribution problems. The use of LAW to aid in webcasting is simple: * You need to pre-load the caches near all the clients. You can use multicast to do this. In fact, at the start of a webcast, you can start the webcast multicast to all the clients cache servers (helped in the process of finding them of course by inverse URR lookups), and just continue (unix file block loading style - if soneone is goign to read a byte of a file, there is a good chance that they will read all of it. In the web, this is not generally true, but in a webcast it is). * Then the protocol is simple one of useing remote control netscape or CCI (perhaps thru a common LAW interface) to step each person thru to the right page on their locally cached (at proxy/server, or in some cases, right at the client) copy. * Repairs to the reliable initial cache load are done wb style (i.e. cache servers multicast requests for missing pages, and the 'nearest and least dearest' answer them). We have to stop thinking about applications for the LAW< as every time we start, we come up with 100 more, and don't have time to finish the LAW, and start on the legislation:-) ...to be continued... From: Chris Clack One of the first things we have to do is to define the semantics of LAW. - What is its purpose? What will it/won't it do? - What is a LAW expression? - How will LAW expressions be combined to make a program? - What is a LAW definition? - How will LAW definitions be used in LAW expressions? ...and so on... from jon Here are some things to think about/worry bout in deisnging LAW (remember: Language for Agents in the Web, see ~jon/doc/epsrc/law.txt) 0. LAW is not a language - its a framework for using many languages to build agents in the web...telescript, tcl, perl etc etc 1. LAW needs an eval model - i.e. do all servers and all clients all have interpresters in or not 2. LAW isfunctional (i..e no side effects, i said NO side effects, e.,g. from retransmissions/retries etc) 3. Types - does LAW have types? it could have none, 1 (strings like Tcl) or have a full Abstract Data Typeing facility i like 0 or All. Tcl 's worst feature is that strings are good enough to do anything with and bad enough to make anything you do horrible. 4. Type constructors - how do we want to address things like streams (sequence of) type, e.g. for unknown length files... 5. time in data - do we want to describe temporal structure? (e.g. for video/audio etc) 6. programmign structures - how many, how complex - iterators, recursirs, remote invokation, multicast, replication, what else...? 7. exceptions (loss of functionality....e.g. partial failure iof a distributed legislature) 8. security (privacy, access control), and safetly/liveness properties ...what to do here? 9. multixast.... that's a start... jon ------------------------------------- Previous work using WWW at UCL includes Tangle [Crowcroft, Joly], and WWW:Beneath the Surf[Handley, Crowcroft]. Relevant research on load balancing was conducted by Dr Steve Hailes and Jon Crowcroft under an ESA contract [Hailes], and by Dr Zheng Wang and Jon Crowcroft under the EPSRC funded FUME project[Wang, Crowcroft]. The Retrieval Level of the assistent implements the searches and retrievals according to the strategieds that emerge from the Reasoning Level. To this end, it is something like existing mechanisms that can be found in WAIS and the Spiders and Robots in WWW. However, emerging work in the WWW community is aimed at providing much more efficient access for clients who portait poor locality of reference in sequences of access. It is highly likely that the Personal Assistent will have exactly such behaviour. The WWW is evolving an hierarchical caching mechanism, to permit on demand replication of data and possible pre-fetching of replicas. These mechanisms are largely aimed at optimising network and server utilisation for current human-driven client access patterns. However, the Reasoning Level of the assistent will be able to provide ample HINTs to the Retrieval Level. Hints are often suggested as ways of optimising caching and routing strategies in low level networking research. We will use them to help in exactly the same way for our application level. To provide a uniform environment for implmeneting the strategies, we propose to implement the Retrieval Level through a common framework that is part of ongoing research at UCL called [Clack, Crowcroft]. LAW - A Language for Agents in the Web. LAW is a functional language, with ADTs HTML is a builtin type, and URLs are first class data types. A URL is the "address" or "reference" type famliar to assembler or C programmers A new MIME type is specified so that clients know that what is returned from a server is a piece of the LAW. Other data types, such as media types simply by using MIME types. All other objects, as in Tcl or Telescript, are strings. This is a predefined type for conveneince and efficiency (like stdio/iostream). Other languages to look at are LICE (Scheme based), Alice, Linda, and other agent work , and JAVA, as well as the Mobisaic work at Washington for mobile agents and the web. Persistence is simply given by writing new WWW pages. A new tag in HTML, allows laws to be embedded in the web. Agents of the LAW are run by WWW servers through messages arriving that indicate a script to run through CGI. Initiators and responders for users either receive passive objects (pages) in HTML, or else receive a new MIME type, application/act, which is passed to a User Agent, launched as a "viewer". This can continue communication (i.e. save state) through CCI back to the Web client, or might receive Legal Data back in the script, that gives it a communications handle direct back to the server. Thus the distributed execution model simpliy relies on existing hooks in CGI and CCI. The input and output of LAW programs are simply the input and output of these functions run by the CGI and CCI evaluations, and are well defined lists of strings (with a well defined syntax in the WWW emerging standards). LAW is primarily used as a framework for gluing the execution of other agent languages together. We do not anticipate large programs being implemented in LAW. To this end it is analgour to Tcl or Telescript. References Tangle: Touring and Navigating the Global Learning Environment, Jon Crowcroft, Gordon Joly, Computer Networks and ISDN Systems, 26, 1994, S71-S74 WWW: Beneath the Surft, Mark Handley and Jon Crowcroft, UCL Press, London, 1995, ISBN 1 85728 435 6 "Load Balancing in Distributed Systems", Chapter in Open Distributed Systems, Jon Crowcroft et al, to appear Dec 1995, UCL Press A Unified Framework for Multicast Forwarding Z. Wang and J. Crowcroft, Lecture Notes in Computer Science, Vol 846, pp 252-258 ed. D Shepard amd H Coulson, Springer-Verlag, April 1994