INTERFACE WWW; (* module, i.e. namespace *) type URI = OBJECT; type Text = ilu.CString; type URIOracle = SINGLETON OBJECT METHODS intern(in literal: Text): URI RAISES URISyntax; join(in here: URI, there: Text) : URI RAISES URISyntax difference(in here, there: URI) : Text scheme(in u: URI): Text; (* @# Scheme object type? *) fragment(in u: URI): Text; END; type URLOracle = SINGLETON OBJECT SUPERTYPES URIOracle METHODS contactInfo(in u: URI, OUT host, port, ???); END; (* local knowledge base; i.e. local view of global KB *) type Universe = SINGLETON OBJECT methods find(in address: URI, inout create: BOOL): Anchor; END; type Anchor = OBJECT METHODS (* Oracle? *) (* belief system: who said so? when? what credentials? *) bind(in interface: URI) : Resource (* RAISES ??? *) END; type ByteSeq = SEQUENCE OF BYTE; type ByteStream = ???; type Entity = OBJECT METHODS header(): ByteSeq; body(out content: BytStream): BOOL; END; type EntityOracle = OBJECT METHODS headerFields(in e: Entity): CARDINAL; nthHeader(e: Entity, in n: CARDINAL, out name: Text, out value: Text); firstHeaderNamed(e: Entity, in name: Text): Text; END; (* sorts of resources *) type Resource = OBJECT; (* @# any common methods? *) type Document = OBJECT SUPERTYPES Resource METHODS get(): Entity RAISES Auth, Comm; (* everything raises these? *) (*@@ credentials, authenticity constraints (caching params) *) (* username, password *) (* if-modified-since *) (* max age *) (* ETag *) (* volume info *) } type ConvertableDocument = OBJECT SUPERTYPES Resource METHODS get(preferences: EntityMetric, out variants: EntitySeq): Entity; END; type EntityMetric = object methods costBenefit(in: Entity): REAL; END; type EntitySeq = SEQUENCE OF Entity; (* example: Anchor * a = Universe.find("http:...", CREATE) Document *d = a.bind(Document) Entity *e = d.get() *) type MutableDocument = OBJECT supertypes Document METHODS (* @# QI on this type might lock the resource? *) put(content: Entity): Entity // what does PUT return? RAISES Auth, Comm; // everything raises these? } type Board = OBJECT supertypes Document METHODS post(content: Entity): Entity // what does POST return? RAISES Auth, COMM; } (* for mailto: URLs *) type MailBox = OBJECT SUPERTYPES Resource METHODS post(content: Entity); END; type MailServer = object supertypes Resource methods post(content: Entity, replyTo: MailBox); END; type TerminalServer = object methods login() RAISES Auth, Comm; END; (* Thesis: just as HTTP was based on the shared under standing around SMTP, NNTP, MIME, and the like, HTTP-NG will be based on the shared understanding aound CORBA, M3, python, Java, Larch, and the like. ILU/WWW is the next paradigm in network applications development after berkeley sockets. @@ phil's notions arout chat being an editing API. Parser "edits" the doc, ala LINCKS. angel: HTTP-NG gateway/proxy. workgroup angel: hyper-G/LINCKS database server. (consistent policies, parallel editing, etc.) spinner dispatcher/ilu requester (encrypted channel, ala SSL) proxy routing: "no route to object", forwarding, etc. access standard links w/out fetching doc (to get GPD, stylesheet, interface, etc.) Persistent objects: Bento as model for comining LINCKS/editing API with caching? (generations, not time stamps nor opaque versions). What about pointer swizzling, ala Texas? integreate anselm's jhttpd "Entity" interface as "local name service". IPR of pass-through, redirect services? (pipe to altavista, replace icons) (tracking ala Yahoo, other redirectors) THINK HARD ABOUT SECURITY -- explicit semantics of calls as sentences. Who said it? when? what scope? GSS API, ban logic. Authorization database: e.g. larch theorems (in general, proof, or at least KB goal search, ala algernon.) client to report broken links to refering server? (even ask to fix them?) python module dictionary as local name service: use method procs as object methods. ISL: "final" annotation, ala dylan, java? (java static -> ISL singleton) @@hmmm... maybe final/sealed are only relevant to implementations. java interfaces -> M3: procedure arguments need arg <: T as well as arg : T! (impl: call-by-name methods) ISL interface for DNS. (URI scheme too) (use standard forms/relational syntax?) dns://www.foo.com?query=A. PUT for writes. relational isomorphism: PUT->update, POST->inset, GET->select. ???->join? isomorphism to Bento, SGML, LINCKS. (context-free grammar in general?) regexp grammar? @@ MIB interface. SNMP (**************************) (* legacy mapping to http *) INTERFACE TelnetTP TYPE Word = ilu.CString; (* no spaces *) TYPE Command = SEQUENCE OF Word; TYPE Status = ilu.CString; (* @@obj type w/ methods to grok XYZ bumbers *) END; INTERFACE HTTP imports TelnetTP, RFC822, Rd; TYPE Request = OBJECT SUPERTYPES RFC822.Header METHODS FUNCTIONAL command(): TelnetTP.Command; FUNCTIONAL body(): BodyOpt; END; TYPE Response = OBJECT SUPERTYPES RFC822.Header METHODS FUNCTIONAL status(): TelnetTP.Status; FUNCTIONAL body(): BodyOpt; END; TYPE BodyOpt = OPTIONAL Rd.T; END; INTERFACE RFC822; (* implementations: c-client library, MH, python lib *) TYPE Header = OBJECT METHODS FUNCTIONAL fields(): HeaderFields; find(name: Id, INOUT index: int): BOOL; (* e.g. for(i=0; h.find("to:", &i);) *) END; TYPE MailMessage = OBJECT SUPERTYPES Header METHODS FUNCTIONAL id(): MessageId; FUNCTIONAL date(): Date; FUNCTIONAL from(): AddressSeq; FUNCTIONAL to(): AddressSeq; FUNCTIONAL body(): Rd.T; END; type MessageId = ilu.CString; type Address = ilu.CString; type AddressSeq = SEQUENCE of Address; type Date = ilu.CString; @@parser TYPE Id = ilu.CString; (* no spaces, : *) TYPE HeaderFields = SEQUENCE OF HeaderField; TYPE HeaderField = RECORD name: Id; value: FieldValue; END; TYPE FieldValue = ilu.CString; (* any newlines must be followed by whitespace *) END; INTERFACE MIME imports RFC822; TYPE MediaType = ilu.CString; (* @@parser ala uri perser matching algorithm *) TYPE BodyPart = OBJECT SUPERTYPES RFC822.Header METHODS FUNCTIONAL mediaType(): MediaType; description(): RFC822.FieldValue; FUNCTIONAL length(): integer RAISES Unknown; FUNCTIONAL body(): Rd.T; END; TYPE MultiPart = OBJECT SUPERTYPES BodyPart METHODS nthPart(n: integer) RAISES CannotSeek; END: END; INTERFACE URI; TYPE T = ilu.CString; (* no spaces *) TYPE Parser = SINGLETON OBJECT scheme(i: T) : Scheme RAISES SyntaxError; contact(i: T, OUT port: integer, OUT user: String, OUT passwd: String) : HostName RAISES SyntaxError; path(i: T): Path; join(here, delta: T) : T RAISES SyntaxError; subtract(here, there) : T RAISES SyntaxError; END; TYPE Path = ilu.CString; TYPE Scheme = OBJECT METHODS FUNCTIONAL name(): String; (*@@ what chars allowed?*) END; END; (****************************) (* SGML scanner *) INTERFACE SGML imports scanner, parser; TYPE Scanner = Scanner.T; TYPE Parser = Parser.T; TYPE Name = ilu.CString (* syntax depends on SGML decl in effect... *) TYPE Oracle = OBJECT METHODS attrValue(name: Name; symbols: IntSeq, tokens: TextSeq, OUT value: ilu.CString) : BOOL; END; END; INTERFACE Scanner; TYPE Target = OBJECT METHODS construct(symbols: IntSeq, tokens: TextSeq); END; TYPE T = OBJECT METHODS text(d: Text; t: Target, INOUT state: integer); END; TYPE Text = ilu.CString; END; INTERFACE Parser; TYPE Target = OBJECT METHODS node(tree: SExpr) END; TYPE T = OBJECT METHODS construct(symbols: IntSeq, tokens: TextSeq); END; END;