Live data from Hacker News

Amazon Ion – A richly-typed, self-describing, hierarchical serialization format

amzn.github.io

21–30 of 240 posts

Re: Amazon Ion – A richly-typed, self-describing, hierarchical serialization format

#22

Pretty neat, but isn't it like *two* formats: one binary and one textual?

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.

Re: Amazon Ion – A richly-typed, self-describing, hierarchical serialization format

#26
post #15

It seems like an odd choice to make the type "metadata" a prefix to the value, rather than a separate field. It feels like overloading. What's the advantage?

Not sure I understand exactly what "a separate field" would look like, but:

1. Considering that a goal of Ion is to be a strict superset of JSON, separate syntax ensures that any JSON value can be parsed without misinterpreting some field as an annotation--there are no reserved/"magic" field names.

2. Annotations can be applied to any type of value, not just objects, which are the only type that have fields.

Re: Amazon Ion – A richly-typed, self-describing, hierarchical serialization format

#27
post #20
post #3

I feel like a lot of file formats came out of companies, but even protocol buffers isn't calling itself google protocol buffers. What is it with modern companies putting their name everywhere they can?

Natural file extension will be .ai despite having no relation to AI

I've seen .ion and .i0n for text and binary ion files. I think amazon ion is like golang - used to clarify meaning not branding

Re: Amazon Ion – A richly-typed, self-describing, hierarchical serialization format

#29

`years::4`? I don't know. What not `4::years`? Also, symbols converted to integers means the receiving end has to already know exactly what they are.

Putting annotations before values is likely to be more useful for streaming parsers than putting them after. Imagine the case where the annotation represents a class that you want to deserialize a large object into.
Post reply on HN