4 ms·
Two representations of the same data structures. Ion text is like JSON, in fact all JSON is valid ion text. Ion text has comments, trailing commas, dates, and
by seniorsassycat 5y ago
Two representations of the same data structures.
Ion text is like JSON, in fact all JSON is valid ion text. Ion text has comments, trailing commas, dates, and unquoted keys. It's a really good alternative to JSON, YAML, or TOML.
Ion binary is compact and fast to parse. Values are length prefixed so the parser can skip over unneeded fields or structs, saving time parsing and memory allocated. Common string values, like struct keys and enum values, are given numeric ids and stored once in a header table.
- ComputerGuru 5y agoDo comments persist in binary serialization or is that a lossy one-way operation?
- the_girabbit 5y agoComments don’t persist in binary. Like white space, they are explicitly not part of the data model.
- seniorsassycat 5y agoI think the ion java library includes a AST parser that includes comments, but the ION data model doesn't. The binary format cannot include comments. I think many text parsers are missing libraries that edit documents in place, preserving formatting and comments.