Skip to content

Instantly share code, notes, and snippets.

@dmbaturin
Last active June 16, 2021 22:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmbaturin/211e1a8a7e69ea1899f98f3b2010c7c3 to your computer and use it in GitHub Desktop.
Save dmbaturin/211e1a8a7e69ea1899f98f3b2010c7c3 to your computer and use it in GitHub Desktop.

HYDIN (Hyperlinked Document Interchange Network)

HYDIN is a set of standards that allow users to publish hyperlinked documents.

It builds on the ideas of the World Wide Web and a few ideas the Web and from older protocols that were forfotten and ignored.

The HYDIN protocol is like:

  • HTTP: Similar set of methods and header syntax.
  • Gopher: it supports machine-readable resource maps.
  • The old shared hosting with tildes but better: protocol address (for connecting) and HYDIN location are separate concepts.

The HYDIN markup language is like:

  • HTML: similar syntax with tags.
  • XHTML: extensible with custom elements.

HYDIN browsers can delegate handling of custom elements to plugins, a bit like web components, but the user can decide what plugin to install and use by default.

Protocol

HYDIN addresses

HYDIN addresses consist of a location part and a document path part, separated by a colon.

Location part generally starts with a hostname or address of a HYDIN server.

<SERVER>[/<LOCATION>]:/<DOCUMENT>

example.edu:/departments/cs/faculty/jrandomhacker/projects/megalisp

(Document /departments/cs/faculty/jrandomhacker/projects/megalisp
       on server example.edu)

192.0.2.45:/test/page (Document /test/page on server 192.0.2.45)

Sub-locations

A server address MAY be followed by a location path, to indicate a sub-location on a server.

HYDIN servers may host multiple independent sites. In this case sites can be separated by a "location path" (this is distinct from a document path that is placed after the colon).

example.edu/users/jrandomhacker:/projects/megalisp

(Document /projects/megalisp
 of the site /users/jrandomhacker
 on server example.edu)

Foreign transports

Foreign protocol address is placed in square brackets, in place of the location part.

Degenerate foreign transport: HYDIN listening on a non-standard port: [example.net:9090]:/about

HYDIN over HTTP: [http://example.net/~jrandomhacker]:/projects/megalisp

Foreign protocol addresses may contain nested square brackets. This is required for IPv6 addresses, so this monstrosity is, sadly, valid—it has to be:

[http://[2001:db8::1]:9090]:/about

Protocol operations

  • GET (retrieves a document)
  • LIST (lists all child nodes under a path)
  • MAP (retrieves a machine-readable map of a path)
  • INFO (retrieves resource information)

GET

The GET method retrieves a document.

LIST

LIST /projects

["megalisp"]

MAP

MAP /

{"projects": [
    {"megalisp": ["about", "downloads", "docs"]}
  ]
}

INFO

INFO /

Description: jrandomhacker's website
Contact: J. Random Hacker <jrandomhacker@example.net>
INFO /files/cat.png

Type: image/png
Size: 45k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment