WebAssembly

WebAssembly = wasm

Code as hypermedia

Is it possible to include webasembly to enrich hypermedia?
WebAssembly is a "assembly" level programming language designed to be a compile target to allow for higher performance computing on the web. Thanks to that origin, it contains a robust containerisation primitives. Given a wasm blob, you can execute it with restricted set of capabilities, flexibly set by the user.
For example, you may run it without network, without storage, with read-only storage, with out the ability to generate random numbers.
Thus, run with a sufficiently restricted set of capabilities it should be safe to execute, up to vulnerabilities in wasm, its implementation, and the rest of the stack.
What It could offer is for hypermedia to be extended by a document. or block in the document, running non-trevial ineractivity
If a hypermedia like this one had wasm blocks that
    Define the wasm block via content addressing
    Defines the resource requierments
    Define the communication channels with the user somehow
Using this one could introduce deep video support, by having a block that likes to an input video file, and exposes a hypermedia surface that includes a timeline. Then the reader can play the video and comment on that timeline. They could transclude part of the timeline into another document, with the knollage that other readers will recivere the same media.
Implementing deep video support this way would mean that the client does not need to be able to read every video format ahead of time. Rather it is for the author to include a valid reader when the introduce a video artefact. The client can help with this process of cause.
Implementing common features like video with this would mean that thoes blobs would have high avalibility on the network, or cached in the client, and the over head would be low.
If the wasm blob is rear, then it does not clutter up the client, and may only be stored on the authors devices.
Consider another use, An animation that illustrates some mathematical concept. The author is free to use or write any fancy animation system they want. Be it something like manim. They can expose not only a timeline, but also interactivity with the that might explore the peramiter space of the animation or simulation.
These different dimensions of interactivity can be exposed to the client, and the client can allow for all the hypermedia goodness on that surfice, like-comment and transclusion accordingly.
And dong thse while penetrating the hypermedia system into the inner structure of these artifacts, allowing for all the hypermedia things, like links, transcusions and commentary.
Let another document transclude that animation along this area of its hypermedia surprise, that is with these parameters.
The surprise is parameterised by the inputs to the deterministic wasm blob, so points on it correspond to states of the dynaic block.
The code and data are keeped together in the document, the code cant pull things from the network, read the disk or flip a coin, so it is deterministic and there is no chance that one day it brakes, or misbehaves.
Particular blocks could be updated individual, by creating a new version of the document. A reader could create a new variant with there own code block.
The surface exposed by blobs should be provided by the client, and standardised. It should form a uniform interface. That interface should allow for transclusion, referencing and marginal notes.
Some use cases I've thought of:
    Handling and hamoganising the wide variety of video and audio file formats
    Allowing for interactive elements like animations and simulations
    Incorporating map based data
    Incorporating interactive data visualisations