| ▲ | RX – a new random-access JSON alternative(github.com) | |||||||||||||||||||||||||||||||
| 38 points by creationix 5 hours ago | 15 comments | ||||||||||||||||||||||||||||||||
| ▲ | btown an hour ago | parent | next [-] | |||||||||||||||||||||||||||||||
This is really interesting. At first glance, I was tempted to say "why not just use sqlite with JSON fields as the transfer format?" But everything about that would be heavier-weight in every possible way - and if I'm reading things right, this handles nested data that might itself be massive. This is really elegant. My one eyebrow raise is - is there no binary format specification? https://github.com/creationix/rx/blob/main/rx.ts#L1109 is pretty well commented, but you can't call it a JSON alternative without having some kind of equivalent to https://www.json.org/ in all its flowchart glory! | ||||||||||||||||||||||||||||||||
| ▲ | Levitating 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
JSON is human-readable, why even compare it with this. Is any serialization format now just a "JSON alternative"? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | barishnamazov 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
You shouldn't be using JSON for things that'd have performance implications. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | Shahbazay0719 4 minutes ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
this is more nuanced than the title suggests. worth reading the whole thing | ||||||||||||||||||||||||||||||||
| ▲ | garrettjoecox 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Very cool stuff! This did catch my eye, however: https://github.com/creationix/rx?tab=readme-ov-file#proxy-be... While this is a neat feature, this means it is not in fact a drop in replacement for JSON.parse, as you will be breaking any code that relies on the that result being a mutable object. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | benatkin an hour ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Interesting. I've heard about cursors in reference to a Rust library that was mentioned as being similar to protobuf and cap'n proto. Does this duplicate the name of keys? Say if you have a thousand plain objects in an array, each with a "version" key, would the string "version" be duplicated a thousand times? Another project a lot of people aren't aware of even though they've benefitted from it indirectly is the binary format for OpenStreetMap. It allows reading the data without loading a lot of it into memory, and is a lot faster than using sqlite would be. Edit: the rust library I remember may have been https://rkyv.org/ | ||||||||||||||||||||||||||||||||
| ▲ | creationix 5 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
A new random-access JSON alternative from the creator of nvm.sh, luvit.io, and js-git. | ||||||||||||||||||||||||||||||||
| ▲ | Spivak 2 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
I love these projects, I hope one of them someday emerges as the winner because (as it motivates all these libraries' authors) there's so much low hanging fruit and free wins changing the line format for JSON but keeping the "Good Parts" like the dead simple generic typing. XML has EXI (Efficient XML Interchange) for precisely the reason of getting wins over the wire but keeping the nice human readable format at the ends. | ||||||||||||||||||||||||||||||||