dkg / draft-rivest-sexp

0 stars 0 forks source link

How does a consumer know what kind of s-expression might be encountered #13

Open dkg opened 1 year ago

dkg commented 1 year ago

I understand that there are three formats of s-expression described in the document: canonical, basic transport, and advanced transport.

what's not clear to me is whether a consumer by definition needs to be able to consume all of these formats, or whether there's some way for the consumer to know what they might end up encountering. For example, when a protocol defines "put an S-expression here", does the protocol need to be clear/explicit about what flavor of S-expression is present? or does the consuming implementation simply always need to be ready to consume any of the formats described here?

Likewise, the "array-layout" memory representation appears to make assumptions about a choice of k that would impact the ability to handle arbitrary data. how is a deployment supposed to know what value of k to choose? Should a protocol using S-expressions commit to fitting within some value of K so that implementations can work reliably (and fail reliably)? if not, how does the implementer know what to choose?

d3e3e3 commented 7 months ago

Section 6, Representation types. says all implementations must support "canonical" and "basic" but that support of "advanced" is optional. I'll see if I can add some text somewhere to make it clearer that a protocol using "advanced" must mandate its support or have gotten some capability notification from the receiver that it is supported.