noosphere
noosphere copied to clipboard
Block layout decoder
In time Noosphere will gain support for arbitrary content types. One way we imagine achieving this is through support of arbitrary content-defined decoders for the body layout of a Memo.
The idea would look something like this:
- Reader looks up some content by slashlink, receives the corresponding CID and resolves a Memo from it
- Memo has one of A) a well-known content-type (e.g., JSON, Subtext) or B) a
Decoder
header whose value is a CID - The body content is then decoded....
- If A) then decoding is baked-in to the Noosphere library
- If B) then a WASM module is resolved from the
Decoder
CID- This module would have a standard interface and would be able to incrementally decode the layout of the body as a byte stream
It's likely that Autocodecs would be well-suited for this use case: https://www.youtube.com/watch?v=nCYj0LghbpI
Sounds good, but: decode to what? What's the supposedly universal representation that decoders are expected to produce?
Yah, good point: we don't need to force everything to converge on a One True Format.
For any given content type, there can be many decoders. The most important thing is that at least one of them produces a content type that is legible to the client.
In the early days, we can support decoders that produce Subtext blocks as an output. In time, Subconscious will support native rendering for structured data formats like JSON and media formats like images - decoders that produce these outputs may also be leveraged.
There will probably be some well-known default decoders for various common type->type conversions. And, the content can suggest specific ones in its headers.