Live data from Hacker News

Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

github.com

111–120 of 174 posts

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#111
post #50
post #11

Finally! I've had to live the JSON nightmare since I left Amazon. Some of the benefits over JSON: * Real date type * Real binary type - no need to base64 encode * Real decimal type - invaluable when working with currency * Annotations - You can tag an Ion field in a map with an annotation that says, e.g. its compression ("csv", "snappy") or its serialized type ('com.example.Foo'). * Text and binary format * Symbol ta…

Okay, but they did a really poor job marketing it in this release. Plus, if it's used within Amazon, why it's Java-only so far?

I'm sure there are ion bindings for every language in common use at Amazon. But a huge percentage of Amazon code is Java, so presumably this one was the best maintained and documented.

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#112
post #50
post #11

Finally! I've had to live the JSON nightmare since I left Amazon. Some of the benefits over JSON: * Real date type * Real binary type - no need to base64 encode * Real decimal type - invaluable when working with currency * Annotations - You can tag an Ion field in a map with an annotation that says, e.g. its compression ("csv", "snappy") or its serialized type ('com.example.Foo'). * Text and binary format * Symbol ta…

Okay, but they did a really poor job marketing it in this release. Plus, if it's used within Amazon, why it's Java-only so far?

[dead]

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#113
post #101
post #25

Earlier quoted context omitted.

Real decimal type - invaluable when working with currency What does JavaScript do with this though, just cast it to a float?

The real way is: "price": { "amount": "1500", "scale": 2, "symbol": "GBP", } Currency has 3 properties, the amount, scale, and symbol. Amount is a string, it holds a bigint. Yes, it's a string. The value of Scale can be up to 5 but is usually 2 or 3. Symbol is the ISO code. Whenever I see a financial system that uses "amount": 15.00 I know that the system is ill-conceived.

What's the scale in this context? Your explanation doesn't really clarify.

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#114

I Consider this Harmful (TM) and will oppose the adoption in every organization where I have an opportunity to voice such. (In its present form, to be clear!) There is no need to have a null which is fragmented into null.timestamp, null.string and whatever. It will complicate processing. Just because you know the type of some element is timestamp, you must worry whether or not it is null and what that means. There sh…

Ion was invented ten years ago according to someone else on this thread. I believe Amazon was mostly a perl and C++ shop at that time.

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#115

Is there a source for benchmarks/reviews for the various ways to represent data? As far as I see it, there are a lot of them that I'd like to hear pros/cons for: json, edn + transit (my fave), yaml, google protobufs, thrift (?), as well as Ion. And where does Ion fit here?

For JVM most popular benchmark is https://github.com/eishay/jvm-serializers/wiki

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#116
post #106

Earlier quoted context omitted.

I don't get this gripe with XML, it is meant to be used by tools not to be written by hand. Where is the XPath and XQuery for JSON? Do people really think that manually iterating over the whole JSON document to find the data or writing yet another parser, is better?

http://jmespath.org/

Any solid Java, C#, C++ libraries?

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#117

To think about the difference between serialization formats, here's an analogy I hope will help. Protocol Buffers (and I think Thrift, and maybe Avro) are sort of like C or C++: you declare your types ahead of time, and then you take some binary payload and "cast" it (parse it actually) into your predefined type. If those bytes weren't actually serialized as that type, you'll get garbage. On the plus side, the fact t…

> It's "statically typed" vs. "dynamically typed" that is the useful distinction.

I officially propose to use the term "accidentally typed" or "eventually typed".

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#118
post #113
post #101

Earlier quoted context omitted.

The real way is: "price": { "amount": "1500", "scale": 2, "symbol": "GBP", } Currency has 3 properties, the amount, scale, and symbol. Amount is a string, it holds a bigint. Yes, it's a string. The value of Scale can be up to 5 but is usually 2 or 3. Symbol is the ISO code. Whenever I see a financial system that uses "amount": 15.00 I know that the system is ill-conceived.

What's the scale in this context? Your explanation doesn't really clarify.

I guess "scale" here is log10 of the multiplier used in storing "amount".

So to convert the value back into the currency range, you're supposed to compute "amount / 10^scale".

Re: Amazon open-sources Ion – a binary and text interchangable, typed JSON-superset

#119
post #55
post #50

Earlier quoted context omitted.

Okay, but they did a really poor job marketing it in this release. Plus, if it's used within Amazon, why it's Java-only so far?

Amazon's mainly a Java shop, not sure if that helps you.

Not really the case - a lot of major projects (like boto and AWS CLI) are in Python.
Post reply on HN