News for hackers. Stuff that matters.
Re:JavaScript is Good, Actually by tim333 on Wednesday May 16, 2018 @03:37AM (#17080647)
I'm slightly puzzled. Array = [[1,2,3],[4,5,6]] seems valid json and I'm not sure what's inefficient or where the keys come in?
Re:JavaScript is Good, Actually by osrec on Wednesday May 16, 2018 @05:04AM (#17080958)
I was thinking of arrays of objects, where the keys are repeated for each object in the array.
Re:JavaScript is Good, Actually by Secretmapper on Wednesday May 16, 2018 @06:09AM (#17081211)
I'm still a bit confused how this is a problem. Can you elaborate?

Is there any serialisation standard that specifically addresses this? I know YAML and TOML doesn't at least (correct me if I"m wrong)

Re:JavaScript is Good, Actually by SigmundA on Wednesday May 16, 2018 @06:30AM (#17081288)
Something like Protobuf where there is a schema is defined means metadata like key name does not get repeated for every object, its only the values.

No more trying to have short names to keep file size down.

Re:JavaScript is Good, Actually by egeozcan on Wednesday May 16, 2018 @08:39AM (#17081878)
IMHO, it sounds like the job of the compression algorithm, not the format.
Re:JavaScript is Good, Actually by imtringued on Wednesday May 16, 2018 @11:09AM (#17083006)
Then use compression. gzipped json is highly efficient over the wire.

https://blog.octo.com/en/protocol-buffers-benchmark-and-mobi...

The primary purpose of binary data formats is that they can be parsed quickly and some even allow direct access without a parsing step.

Re:JavaScript is Good, Actually by osrec on Wednesday May 16, 2018 @11:32AM (#17083206)
That's what I said in my first comment, no?
Re:JavaScript is Good, Actually by zinckiwi on Wednesday May 16, 2018 @03:52AM (#17080694)
s/arrays/"collections of homogenous objects" and it's a fair point.