amazon-ion / ion-docs

Source for the GitHub Pages for Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
23 stars 23 forks source link

Clarify transcoding capabilities and requirements #311

Open toddjonker opened 6 months ago

toddjonker commented 6 months ago

One fundamental capability of Ion 1.0 is that any document can be transcoded between text and binary without access to any shared symbol tables, even without evaluating local symbol table directives. For the moment, I'll call this capability "standalone transcoding" since the document is all that's needed to support transcoding.

Note that this encompasses the basic case of pretty-printing a binary document for human consumption; any Ion 1.0 binary document can be pretty-printed as text in a standalone fashion. It might be full of SIDs, but it's structurally accurate.

It's recently become clear that 1.1 has broken this capability:

Since the binary pretty-printing has long been a significant part of Ion's elevator pitch, I think we need to have a clear story here. At the very least, we should work through the encoding conditions required to enable things like standalone transcoding and pretty-printing, so we can advise users what to do or avoid if they want their documents to retain that property.

@tgregg (I think) suggested that we add a distinct directive syntax that guarantees the document (or at least the segment) supports desirable transcoding properties without access to shared modules, and I think that's a very good idea.

toddjonker commented 6 months ago

Relevant discussion and spec passage at https://github.com/amazon-ion/ion-docs/pull/308#discussion_r1568992573