jcof icon indicating copy to clipboard operation
jcof copied to clipboard

Streaming format

Open riking opened this issue 3 years ago • 1 comments

It's trivial to extend this format to support streaming. Here I imagine some specs for it.

Suggested BNF additions:

grammar ::= string-table ';' object-shape-table ';' ows value
streaming-grammar ::= string-table ';' object-shape-table ';' ows (value ';' ows)*

ows ::= *( %x20 / %x0A / %x0D )

Suggested specification phrasing:

The streaming format is recognized by finding a semicolon after the first complete JCOF value. Parsers not instructed to expect an object stream SHOULD recognize this situation and emit an error.

Implementations using the streaming grammar SHOULD emit a newline after the object shape table and after every emitted object (at the "ows" production in the BNF). This enables compatibility with existing line-streaming programming styles.

riking avatar Jul 17 '22 07:07 riking

I was also thinking about streaming, I think a major issue is that the string-table is sent before objects, so you can no longer amend it. I think for streaming it would be nice if there would some way to send intermediate string tables and object formats (the encoder doesn't necessarily know all object shapes upfront).

mycroes avatar Jul 17 '22 11:07 mycroes