cognitect / transit-format

A data interchange format.
1.88k stars 36 forks source link

53 bit is written in the spec as the cutoff for signed integers. #26

Closed delaneyj closed 9 years ago

delaneyj commented 9 years ago

Working on a C# 4.0+ transit reader/writer. The specification basically says signed integer above 52 bits but below or equal to 64 bits should use the ~i prefix and above that ~n. In the "ints_interesting.json" example it appears the ~i begins at 9007199254740993 when for signed 64bit numbers it should begin at 4503599627370496. It is total possible I am misreading the spec but would appreciate some clarification.

jlouis commented 9 years ago

I had the same problem, see issues #14 and #15

The short TL;DR is that your code must be ready to accept any encoding of integers, but #15 has the details. Does this clarify things, or do you have further questions?

dchelimsky commented 9 years ago

The spec says "< 2^53" (i.e. < 9007199254740992) is a number, so the exemplar and the spec are off by 1. I'll chat w/ the other maintainers and get these aligned.

jlouis commented 9 years ago

Awesome, please keep me in the loop so I can make sure the OCaml and Erlang variants are in accordance :)

dchelimsky commented 9 years ago

I'll follow up on this issue once it's resolved. That sufficient to keep you in the loop @jlouis?

jlouis commented 9 years ago

It'll be perfect, thank you!

dchelimsky commented 9 years ago

The transit spec is following http://rfc7159.net/rfc7159, so the implementation is wrong. We'll get the implementations aligned with the spec and re-gen the exemplars soon.

delaneyj commented 9 years ago

Great thank you guys. Awesome to wake up to such great feedback!

dchelimsky commented 9 years ago

Exemplars are updated and all of the Cognitect-maintained kits have been released except for transit-python, which should get dropped by early next week.

dchelimsky commented 9 years ago

FYI - transit-python went out last week as well.

dchelimsky commented 9 years ago

This is resolved in the following releases of all the kits:

transit-js-0.8.783 transit-cljs-0.8.207 transit-java-0.8.287 transit-clj-0.8.271 transit-python-0.8.250 transit-ruby-0.8.588 transit-ruby-0.8.588-java