cbor-wg / edn-literal

Application-oriented literals for CBOR extended diagnostic notation
Other
0 stars 7 forks source link

Tag for undecoded-EDN-literal? #13

Closed chrysn closed 11 months ago

chrysn commented 11 months ago

For elisions in CDN (lost track a bit ... where is that?), there was the suggestion to allocate tag 888 so that even incomplete EDN can be expressed in CBOR at least with a tag that the later user will stumble over.

Does it make sense to do the same with EDN-literals, eg. 123456(["dt", "2023-01-01"])? A diagnostic parser could emit that (at least when --dont-fail-just-because-you-dont-know-the-application-literal is given), and it'd be useful when a tool takes CBOR and wants to annotate it before doing the "dirty" (less library support) work of diagnostic notation. For example, even though the Python cbor-diag library is really really bare bones (converting bytes into str and vice versa), a tool annotating dates could load the CBOR into Python data structures, find its way through dicts and arrays to the points where it'd see a date to convert to discordian dates, convert it to such a tagged value (123456(["ddt", "Pungenday, the 57th day of Confusion in the YOLD 3176"])), and let the existing diag implementation (that's never heard of this newfangled "ddt" even though it of course supports application literals).

Can be done later as well, but if it sounds like a good idea, why not do it right away.