dir The medium is the language .as Article .property description text A critical overview of FIFO: a semantic data structure for hypermedia .property cover image Johannes Gutenberg .property source id gutenberg.webp info Created time 2025-01-06 anchor Introduction text This article briefly introduces the idea and a proof-of-concept implementation of FIFO: a language that blurs the distinction between documents and data structures. text FIFO stands for File Format. text This language is the central product of an independent research effort with the goal of devising a rigorous and practical model for the mass-production of accessible hypermedia documents. text Relative to its prominence, hypermedia has not been industrialized enough. Outside of information silos, the lifecycle of hypermedia content still involves substantial degrees of artisanry; therefore, it's hard to consider it a cheap, commonly accessible good. text Let me offer a counterexample. Photography is a highly industrialized medium. For that reason, it's in general cheaper to independently produce a picture than it is to independently produce hypermedia content. Beyond the acquisition of the tools, one does not need to coordinate with private entities, forfeit their privacy or hire specialized services in order to produce a picture. text The document you are reading is itself encoded and rendered in this language. This should provide enough initial evidence of its strenghts, limitations and feasibility, while dispensing with excessive explanation. text On the encoding part, a FIFO document is expressed by a very simple textual file format. link The FIFO source of this article .property source id ./index.fifo.txt text As it stands, the Javascript shell code on this page is fetching and parsing the document's FIFO source into an intermediary format, which is then fed to a generalized rendering pipeline to yield a visually appealing interface. text The way this is done breaks with almost every piece of common sense of how Web pages should be constructed. That's because this is not a traditional Web page. Categorically, it's more like the embedded PDF renderer featured in browsers, except the renderer code is loaded on-demand and FIFO is a Web-aware format. text Furthermore, FIFO defines an interface model which can be consumed by ad hoc clients. There's nothing bounding FIFO to Web browsers. The browser is just a convenient GUI environment for the format, given its widespread availability. text Note that, in the context of Web browsers, other shells could be written for FIFO. This shell is merely my particular implementation. image A syntax highlighted snippet of FIFO .property source id fifo.webp text The FIFO text format is not the sole aspect of the language. The graphical translation is also an integral part of it, since it is roughly isomorphic to the textual structure of the language. text There are yet more aspects to the language beyond its textual and graphical representations. It also features an intermediary in-memory representation, as well as a series of subsystems necessary for building a vertically integrated information system. But, as I mentioned, this is simply a proof-of-concept, and only a fraction of the needed subsystems have been developed. text More in-depth technicalities shall be discussed in future articles if I manage to secure funding for the project. So far the research has been bootstrapped and, sadly, I'm lacking the resources to advance the project. anchor What makes FIFO great text FIFO stands out from traditional hypermedia languages in several ways. Its strengths are the result of an extensive and intensive effort to balance the economics and ergonomics of hypermedia throughout all of its tangible facets. text It is designed to support structure-preserving graphical translations. .level 1 text This is the core property that allows the language to be maximally economic, as presentational aspects are systemic and emergent, thus eliminating a vast domain of complexity. The disposition and styling architecture is derived once and reused en masse by a client software. text It is based on a minimal model consisting of a single construct: the type-value tuple. .level 1 text This simpler model has virtually no syntax footprint, is highly compressible and looks nearly natural. text It has first-class support for metadata, structural organization and open-ended composition. .level 1 text A FIFO document resembles a file system, in that it can host a structured and metadata-rich corpus of knowledge in a single volume, e.g. an entire book or an in-depth learning material. FIFO has no strict concept of pages, instead it embraces the strengths of digital media and free-form hierarchical composition, making the format highly malleable and expressive. text It has accessibility as a foundational principle. .level 1 text The high signal-to-noise ratio of the language affords excellent inclusivity. The FIFO syntax is very similar to the accessibility trees derived by Web browsers. There's nothing an author needs to do to make a FIFO document accessible – accessibility is baked-in. Even if all you have is a text editor and a raw FIFO text file, you'll still have a highly meaningful and readable piece of content. text It features a simple type system with aliasing support to convey additional semantic meaning. .level 1 text FIFO has an intentionally limited type dictionary. For instance, there's only one sectioning construct: the dir type. But, by using alises we can refine a dir as being a Section, an Article, a Book, a Chapter, and so on – aliases are open ended. snippet Example of aliasing a dir in FIFO .property language name FIFO .property source code | dir The medium is the language | .as Article snippet Example of aliasing a name in FIFO .property language name FIFO .property source code | name Michael Scott | .as Regional Manager text Type alising will greatly aid document navigation once we implement facilities for indexing and searching. A more in-depth exploration of the type system shall be published in future articles. text It's a standalone textual index file. .level 1 text This means that storing and transporting hypermedia volumes is as simple as bundling the FIFO index file with the referenced external media files in an archive format, e.g. volume.fifo.zip. No complex binary formats, manifests, assets, scripts and stylesheets are neccessary. It also means FIFO is not bound to any particular environment or technology – it's pure data. text It outsources specialized media to the appropriate formats. .level 1 text FIFO does not attempt to do it all. For instance, it has no inherent support for tabular data, as tabular data is best encoded using tabular formats such as CSV. For such cases, FIFO reserves a generic type called media, which expects a source property referencing an arbitrary file. If the client software can interpret and render the referenced file format inline, it may do so; if it does not support the format, it should gracefully degrade by rendering it as a generic file attachment. This strategy ensures that distinct media types remain decoupled and are transported in the best, most compatible encoding. snippet Example of arbitrary media embbeding in FIFO .property source code | media Any media | .property source | id media/any.ext text It's scraping-friendly. .level 1 text The goal of scraping is, essentially, to filter-out noise and extract relevant data from an information source. Since FIFO documents are pure data, scraping it is trivial. Automated retrival and processing is not inherently malign, so I consider this quality a systemic advantage. text It's incredibly productive. .level 1 text As I write this article, I am realizing that my theory that free-form hierarchical composition would afford great writing fluency is actually living to its promises. Flat document formats inheriting the print paradigm can be notoriously taxing in terms of structural organization: extending a narrative upon the introduction of new concepts breaks thematic flow; alternatively, splitting concepts breaks contextual locality, requiring additional prose to reestablish it. Conversely, in FIFO, the ability to branch a document at arbitrary points eliminates such problems. Not the mention the weightlessness coming from the absence of aesthetic pressure – a massive cut on the number of decisions required to put information together. anchor What makes FIFO peculiar text FIFO is not without its quirks and limitations, which stem either from trade-offs of hard requirements or from circumstantial design decisions pertaining to the proof-of-concept status of this implementation. text It's static. .level 1 text FIFO's goal is to be a semantic and structured container for arranging multimedia content. Its design draws heavily from file systems, thus adopting the principle of outsourcing to achieve specialization. At the cost of limited native features, this approach ensures the longevity of the host media by not constraining it to any particular paradigm of interactivity. text It's impractical to render a flat document. .level 1 text FIFO is a hierarchical language, making it impossible to create a universal mechanism for flattening documents, as their depth can be arbitrary. text List numbers appear above items instead of on the sides. .level 1 text Lists in traditional documents have many limitations: they don't scale well with indentation; have poor handling of non-textual content, and are difficult to edit. I wanted to break free of these limitations, so the obvious solution was to have a dedicated row for list numbers, hence leaning on vertical indentation. text Lists in FIFO are encoded by attaching a reserved level metadata to an element, which expects an integer value expressing the indentation level for the element. There's no explicit listing construct. anchor The following structure… snippet Example of list encoding in FIFO .property language name FIFO .property source code | text Listed as 1 | .level 1 | text Listed as 1.1 | .level 2 | text Listed as 1.1.1 | .level 3 | text Listed as 1.1.1.1 | .level 4 anchor Renders as… text Listed as 1 .level 1 text Listed as 1.1 .level 2 text Listed as 1.1.1 .level 3 text Listed as 1.1.1.1 .level 4 text Rendering lists like this guarantees a consistent column width for all listed items and scales indefinitely, which is ideal for a system designed to be robust under arbitrary content structures. text A limitation with this encoding strategy is the inability to have sparse lists, where listed items are not adjacent, since there's no way to infer if the next item after a non-indented item constitutes a new list or is a continuation of the previous one. text Metadata takes significant vertical space when rendered. .level 1 text As a consequence of being too serious about treating metadata as first class information, and having consistent layout across all screen sizes, we're required to dedicate a full row for each attribute. So if a given tree has a lot of attributes, it will require quite a bit of scrolling in order to reach the "actual" content. text The lack of localized styling makes for monotonous documents. .level 1 text FIFO documents are globally styled by the viewer application, therefore bounding the entire document to a singular aesthetic. Trees with a large number of undifferentiated elements will inevitably appear plain. text Every element demands a nominal value. .level 1 text The relentless pursuit of accessibility at a foundational level demanded that every non-textual element be identified by a name. Some people might consider it overzealous, despite the sound reasoning supporting this design. text Accessibility patterns are not standard. .level 1 text I have elsewhere boasted about the inclusivity potential of FIFO documents. However, being such a distinct format, the current labeling and announcement heuristics are experimental. Advancing on this front will require extensive testing and user feedback. text It's a fully serial format. .level 1 text Parallel or side-by-side content is not supported in FIFO because such arrangements encode no information at the semantic level. Moreover, humans interpret information serially, so ordering is inevitably derived. FIFO acknowledges and embraces this fact as a limiter of complexity, favoring unambiguous ordering. text This does not mean, however, that a FIFO client cannot employ parallel panes as an aid to content consumption; it's just that, in this scenario, each stream is its own context and is meant to be read separately. text Natural element identifiers are not stable. .level 1 text When parsed into memory, each element is assigned a serial identifier, starting at 1. However, since these addresses are generated generically, they can't reliably identify the same element across document revisions. Hence these identifiers cannot be used as references. A dedicated system of stable identifiers must be developed. anchor What makes FIFO hard text Most of the aspects that make FIFO challenging to develop stem from its novelty. It was a conscious decision not to base the research and development on marginal improvements to current technologies and standards. text It must be thoroughly specified. .level 1 text If we have any hope of making FIFO an wide-spread language, substantial resources must be allocated to write technical specifications. An effort best tackled cooperatively, which is a challenge in itself. text It requires special tooling. .level 1 text Parsers, compilers, validators, transpilers, exporters, a query language and what not – these all need to be specially developed and should take time to stabilize and mature. text It expects authors to renounce control over presentation style. .level 1 text Styling of FIFO documents is controlled by the client software and, by extension, the readers. I’m unsure how difficult it might be to convince people that this approach can actually be liberating. The fact that everyone’s social profiles look the same gives me some hope. Though, in social sites, the uniformity is often accepted as a trade-off for having an audience. text It requires a graphical editor. .level 1 text FIFO documents are not designed to be manually authored through its textual syntax; a graphical editor is essential to achieve its goal of being a popular hypermedia format. text It must prove itself. .level 1 text The promise of hypermedia as a commodity cannot be sustained by faith – there's no hype for it. The only way to cement it as a necessity is to make it happen. anchor What makes FIFO disruptive text Envisioning a speculative scenario where a mature and widespread FIFO ecosystem exists, what communication structures could it displace or make obsolete? text In essence, I believe that any proprietary or complex products, services, and technologies oriented toward the creation, management, and distribution of hypermedia directories would become uncompetitive. I say this purely based on the cost advantage offered by FIFO's model. text I argue, also, that FIFO would challenge established categories. If you have an unified way to compose and distributed free-form multimedia content, then any format that distinguishes itself by virtue of being a particular articulation of a hypermedia directory ceases to be a meaningful category.